Skip to content

Added format conversion caching when Serializing/Deserializing#710

Open
HassanAkbar wants to merge 3 commits into
mainfrom
feature/format-conversion-caching
Open

Added format conversion caching when Serializing/Deserializing#710
HassanAkbar wants to merge 3 commits into
mainfrom
feature/format-conversion-caching

Conversation

@HassanAkbar

Copy link
Copy Markdown
Member

fixes #267

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an opt-in, store-backed caching layer for format conversions to reduce repeated serialization/deserialization work (fixes #267), with configuration, documentation, and test coverage.

Changes:

  • Introduces cache_conversions + with_conversion_cache to cache from_* results (model instances) and to_* results (serialized strings).
  • Adds Lutaml::Model::Config.conversion_cache with lazy auto-detection of a default in-memory Lutaml::Store::BasicStore when lutaml-store is loaded, plus global disable via false.
  • Documents conversion caching behavior and adds comprehensive specs for cache key semantics, opt-in behavior, and backend quirks (e.g., CacheStore JSON round-tripping).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
spec/lutaml/model/conversion_caching_spec.rb New specs covering caching behavior, key separation, disablement, and backend error propagation.
README.adoc Adds a feature bullet and a new “Conversion caching” section referencing the dedicated doc.
lib/lutaml/model/serialize/format_conversion.rb Wraps from/to conversions with the caching layer.
lib/lutaml/model/serialize/conversion_caching.rb New caching implementation (keying, payload digesting, store integration).
lib/lutaml/model/serialize.rb Autoloads/includes the caching module into Serializable class methods.
lib/lutaml/model/configuration.rb Adds conversion_cache config with lazy default store auto-detection.
lib/lutaml/model/config.rb Exposes Config.conversion_cache getter/setter API.
Gemfile Adds lutaml-store for development/test usage.
docs/conversion_caching.adoc New detailed documentation for activation rules, semantics, and limitations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/lutaml/model/serialize/format_conversion.rb
Comment thread lib/lutaml/model/serialize/conversion_caching.rb
@HassanAkbar HassanAkbar marked this pull request as ready for review June 17, 2026 12:16
@HassanAkbar HassanAkbar requested a review from ronaldtse June 17, 2026 12:17
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.

Support serialization caching

2 participants