Refactor Core Architecture and Transition to v2.0.0.#22
Merged
Conversation
- Modularized patch.go and condition.go into specialized sub-files
(ops, parser, serialization, utils) to improve maintainability.
- Unified Copy and Diff APIs using a polymorphic functional options
pattern, introducing shared IgnorePath and SkipUnsupported options.
- Optimized Copy performance (up to 7x faster for basic types) via:
- sync.Pool for pointersMap to reduce garbage collection pressure.
- Fast-path for basic types bypassing expensive recursion.
- Lazy path string construction.
- Optimized Condition evaluation by replacing reflection-based calls
with a direct internal interface.
- Enhanced Diff with fast-paths for simple slice appends/removals.
- Refined unsafe.DisableRO usage to be surgical, targeting only
unexported fields.
- Fixed critical bugs in Copy regarding cyclic self-referencing value
types and nil interface handling.
- Completely restructured README.md for better clarity and added
comprehensive Go doc comments across the public interface.
- Reorganized and expanded test suite to match new modular structure.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR represents a major evolution of the deep library. It focuses on modularizing the internal implementation, significantly improving performance and memory efficiency, and unifying the public API into a more ergonomic and consistent model. Due to breaking changes in the Condition interface and function signatures, this PR transitions the project to v2.0.0.
Key Changes