Skip to content

Add BSON support#9

Open
wilkolbrzym-coder wants to merge 3 commits into
mainfrom
BSON-3032461295828104591
Open

Add BSON support#9
wilkolbrzym-coder wants to merge 3 commits into
mainfrom
BSON-3032461295828104591

Conversation

@wilkolbrzym-coder
Copy link
Copy Markdown
Owner

High-performance BSON support for Glaze library.

Features:

  • Full support for BSON primitives (Double, String, Int32, Int64, Boolean, Null).
  • Serialization and deserialization of C++ structs and maps as BSON Documents.
  • Support for BSON Arrays (mapping to C++ ranges).
  • Robust handling of enums, variants, and nullable types (optional, pointers).
  • Tag-aware reading to prevent binary stream desynchronization.
  • Clean C++20 implementation.
  • Extensive test suite with 347 passing assertions.
  • Performance benchmarks showing BSON outperforming JSON/BEVE in some scenarios.

PR created automatically by Jules for task 3032461295828104591 started by @wilkolbrzym-coder

- Implemented BSON serialization and deserialization in `include/glaze/bson/`.
- Integrated BSON into `glz::opts` and `glz::read`/`glz::write` API.
- Added 347 test cases in `tests/bson_test/`.
- Added performance benchmarks in `benchmarks/bson_benchmark.cpp`.
- Ensured C++20 compatibility by avoiding C++23 features like `std::byteswap`.
- Implemented tag-aware reading for robust stream synchronization.
- Optimized array index serialization using `glz::to_chars`.
@google-labs-jules
Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Implemented BSON serialization and deserialization in `include/glaze/bson/`.
- Integrated BSON into `glz::opts` and `glz::read`/`glz::write` API.
- Added 347 test cases in `tests/bson_test/`.
- Added performance benchmarks in `benchmarks/bson_benchmark.cpp`.
- Ensured C++20 compatibility.
- Implemented tag-aware reading for robust stream synchronization.
- Optimized array index serialization using `glz::to_chars`.
- Added BSON format support (glz::BSON = 40)
- Implemented BSON reader and writer in include/glaze/bson/
- Added safety checks against malformed/truncated BSON data
- Integrated BSON into global options and main library headers
- Added comprehensive unit tests in tests/bson_test/
- Added BSON performance benchmarks in benchmarks/
- Optimized map lookups and ensured C++23 compatibility
- Fixed minor compatibility issues in reflect.hpp
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.

1 participant