[go: up one dir, main page]

lexical-core 0.5.0

Lexical, to- and from-string conversion routines.
# Changelog

Notes significant changes to lexical-core.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [0.5.0] - 2019-08-20
### Added
- Added ffi::Result, an FFI-compatible tagged union, to store results for FFI-compatible functions.
- Added `MAX_*_SIZE_BASE10` constants, to determine the maximum size in bytes a formatted type will take in base 10.
- Added `ato*_partial` functions, which parse until an invalid digit is found, returning the value and number of processed digits.

### Changed
- Improved code generation and reduced binary bloat. There are a few algorithmic differences that make this possible, but the parsers now generally extract the float subcomponents first, then parsed known-good data after for enhanced performance.
- Updated the benchmarks and benchmark results.
- Add variants for lexical_core::ErrorCode. Added `Underflow`, to detect numerical underflow, `EmptyFraction`, to detect floats with an empty integer and fraction components, and `EmptyExponent`, to detect floats with no value following the exponent character.
- Changed Result to use `std::result::Result`.
- Fixed proptests and added more comprehensive proptests thanks to @dangrabcad.
- Moved FFI-compatible code to the public `ffi` module.
- Removed `*_slice` from functions in the public API, since there is no naming conflict with FFI code.
- Removed `*_ffi` and `*_FFI` from public functions and constants.
- Optimized the itoa exporters using specialized optimizations for the type size and number of digits. The resulting performance excels for all values, providing 2-3x performance improvements, with exceptional performance for values with a small number of digits.
- Optimized integer division algorithm based off the compiler-builtins crate to avoid redundant calls to an expensive compiler intrinsic (`__udivmodti4`).
- Optimized the atoi algorithm for 128-bit integers by using intermediary 64-bit integers, leading to performance boosts of up to 30x.

### Removed
- Removed the unchecked parsers from the public API. `try_parse*` has been replaced with `parse*`.
- Removed ErrorCode::Success, since with the new result types it was redundant.

## [0.4.3] - 2019-06-26
- Fixed a bug (issue #20) leading to incorrect float parsing (1 ULP error) for slow-path algorithms containing floats with a trailing 0-digit in the fraction component (discovery by @dangrabcad). Added in comprehensive unittests to avoid future regressions.
- Fixed CI for older Rustc versions due to issues with the `edition` keyword.
- Updated dependencies (credit to @junhoo).
- Updated the benchmarks for float and integer formatting to use `Write::write_fmt` rather than `to_string` to avoid heap allocation leading to misleading results (credit to @RazrFalcon).

## [0.4.2] - 2019-06-24
### Added
- Comprehensive continuous integration unittests for numerous platforms, based off the [trust](https://github.com/japaric/trust) templates.
- Added known issue for a non-default, lossy setting on armv6 architectures.

### Changed
- Bug fix for 32-bit targets.

## [0.4.1] - 2019-06-20
### Added
- Backwards compatible support for Rustc 1.24.0.

### Changed
- Worked around a bug in the internal float formatter where `&arr[idx]` creates a local copy in Rust versions before 1.28.0, creating a dangling reference after the scope ends. For more details, see `cached_grisu_power` in `/lexical-core/src/ftoa/grisu2.rs` .