Skip to content

feat: modernize simpleson with C++17, optimize performance, and add benchmark integration#49

Open
yeah14 wants to merge 2 commits into
gregjesl:masterfrom
yeah14:feat/cpp17-modernization-and-benchmarks
Open

feat: modernize simpleson with C++17, optimize performance, and add benchmark integration#49
yeah14 wants to merge 2 commits into
gregjesl:masterfrom
yeah14:feat/cpp17-modernization-and-benchmarks

Conversation

@yeah14
Copy link
Copy Markdown

@yeah14 yeah14 commented Apr 17, 2026

Summary

  • Modernize simpleson core implementation in json.h and json.cpp with C++17-oriented cleanup (safer casts, exception handling improvements, clearer resource semantics, and related maintainability updates).
  • Improve runtime performance in key paths including parsing, serialization, and object-key access while keeping external JSON semantics and usage largely compatible.
  • Expand README.md with modernization notes, benchmark results, test/coverage instructions, and practical usage examples.
  • Integrate baseline_benchmark_test into the root build and add robust dependency gating:
    • Benchmark targets are added through the top-level CMake flow.
    • If Google Benchmark is unavailable, benchmark targets are skipped gracefully.
    • Memory benchmark target is only built when allocounter target exists.
    • Windows runtime DLL copy behavior is preserved for runnable benchmark executables.

Why

  • Increase code safety and long-term maintainability by replacing legacy patterns with modern C++ practices.
  • Reduce overhead in common workloads and provide measurable evidence of improvement.
  • Make benchmark/test workflows reproducible for reviewers and contributors without forcing hard dependency requirements.

Build & compatibility notes

  • Added CMake option: SIMPLESON_BUILD_BASELINE_BENCHMARKS (default ON).
  • Environments without benchmark dependencies can still configure and build the project successfully; missing dependencies now result in clear skip messages instead of configuration failure.

Test plan

  • Configure project with CMake in a clean build directory.
  • Build core library and existing tests successfully.
  • Run jobject_semantics_test and verify all tests pass.
  • Build and run benchmark targets where dependencies are available.
  • Verify graceful skip behavior when Google Benchmark and/or allocounter is absent.

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