Skip to content

Conversation

@pro100andrey
Copy link
Owner

@pro100andrey pro100andrey commented Dec 25, 2025

This pull request introduces the major 3.0.0 release of the pro_binary Dart library, focusing on a comprehensive documentation overhaul, significant improvements to the README for clarity and real-world usage, enhanced testing, and CI/test configuration updates. Additionally, it removes the now-unnecessary BinaryReaderInterface abstraction and adds a benchmark baseline for performance tracking.

Highlights of the release:

  • The documentation and README have been rewritten for clarity, practical guidance, and best practices.
  • 23 new comprehensive tests have been added to ensure the reliability of critical string and encoding methods.
  • Benchmarking and test exclusion for performance tests are now integrated into the project and CI.
  • The BinaryReaderInterface file has been removed, reflecting a simplification of the codebase.

The most important changes are:

Documentation and Usability Improvements

  • Major overhaul of the README (README.md): The README is now rewritten with a clear value proposition, concise API examples, real-world usage patterns, best practices, encoding efficiency tables, and updated installation instructions for version 3.0.0.
  • Comprehensive documentation update (CHANGELOG.md): Details the documentation overhaul, new API usage examples, performance notes, and inline comments for complex algorithms.

Testing and Benchmarking

  • Addition of 23 new comprehensive tests for string and encoding methods, as well as 70+ dedicated VarInt/VarUint tests (documented in CHANGELOG.md).
  • Exclusion of benchmark tests from CI by default in .github/workflows/test.yml and configuration of test tags in dart_test.yaml for better test management. [1] [2]
  • Addition of a benchmark_baseline.json file to track performance medians for key operations.

Codebase Simplification

  • Removal of lib/src/binary_reader_interface.dart, cleaning up unused or redundant abstractions.

Minor Fixes

  • Updates to example code to use the new .little syntax for endianness in example/main.dart. [1] [2]

This release significantly improves the developer experience, documentation quality, and reliability of the pro_binary library.This pull request introduces a major update focused on documentation improvements, enhanced test coverage, and minor API usage clarifications. The most significant changes include a comprehensive rewrite of the documentation, substantial expansion of the test suite, and simplification of usage examples. Additionally, the verbose BinaryReaderInterface interface has been removed, streamlining the codebase.

Documentation and Examples:

  • Overhauled all documentation: Added detailed API docs, usage examples, inline algorithm explanations, best practices, and a migration guide. The README was rewritten for clarity and real-world usability. [1] [2]
  • Updated code examples in example/main.dart to use the new, shorter .little syntax for specifying endianness, improving code clarity. [1] [2]

Testing:

  • Expanded the test suite with 23 new comprehensive tests, specifically targeting writeVarString(), getUtf8Length(), and readVarString(), as well as edge cases for UTF-8, VarInt, and error handling.

Codebase Simplification:

  • Removed the verbose BinaryReaderInterface abstract class and its extensive inline documentation, reducing boilerplate and centralizing documentation in the README and API docs.

These changes make the library easier to use, better documented, and more robustly tested.

- Introduced a new `FastBinaryWriterBenchmark` class to evaluate performance of the FastBinaryWriter.
- Added extensive test cases for writing and reading various data types, including Uint16, Int16, Uint32, Int32, Uint64, Int64, Float32, and Float64, ensuring little-endian format is consistently used.
- Updated existing tests to utilize FastBinaryWriter instead of BinaryWriter for improved performance.
- Enhanced string writing tests with longer strings containing emojis and complex characters to stress UTF-8 encoding logic.
- Ensured all tests validate the expected byte lengths and reset conditions after taking bytes.
…naryReader

- Added `writeVarBytes` and `readVarBytes` methods for handling length-prefixed byte arrays.
- Introduced `writeVarString` and `readVarString` methods for length-prefixed UTF-8 encoded strings.
- Implemented `getUtf8Length` function to calculate the UTF-8 byte length of strings without encoding.
- Enhanced performance tests for BinaryReader and BinaryWriter to include benchmarks for new methods.
- Updated existing tests to cover new functionality and ensure correctness.
- Bumped version to 3.0.0 to reflect breaking changes and new features.
… tests for RangeError, and add benchmark configuration
- Implemented benchmarks for skip operations with small, medium, and large offsets.
- Added seek operation benchmarks for forward, backward, and random access.
- Created benchmarks for rewind, reset, and getPosition operations.
- Included benchmarks for remainingBytes and realistic parsing navigation patterns.
- Developed string read benchmarks for ASCII, short, long, Cyrillic, CJK, emoji, and mixed Unicode strings.
- Added benchmarks for VarString reading and realistic message structures.
- Implemented benchmarks for reading VarInt and VarUint with various sizes and distributions.
- Implement benchmarks for writing fixed-size integers (Uint8, Int8, Uint16, Int16, Uint32, Int32, Uint64, Int64) with both big-endian and little-endian formats.
- Create benchmarks for writing floating-point numbers (Float32, Float64) including various scenarios such as small values, large values, and special values.
- Introduce benchmarks for string writing, covering ASCII, Cyrillic, CJK, emoji, and mixed Unicode strings, as well as VarString scenarios.
- Add benchmarks for VarInt and VarUint writing, including fast paths and mixed sizes.
- Implement a pool of BinaryWriter benchmarks to evaluate performance in acquiring, releasing, and reusing writers.
…terations

- Updated all benchmark tests to use a default BinaryWriter without specifying an initial buffer size.
- Increased the number of iterations for various read benchmarks from 100 to 1000 to enhance performance testing.
- Added exercise methods to all benchmarks for consistency and clarity in execution.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants