Merkle tree for style reusability#268
Open
anykeyh wants to merge 2 commits intoweshatheleopard:masterfrom
Open
Merkle tree for style reusability#268anykeyh wants to merge 2 commits intoweshatheleopard:masterfrom
anykeyh wants to merge 2 commits intoweshatheleopard:masterfrom
Conversation
added 2 commits
June 24, 2017 18:04
No more bug on my production excel test set, and ~25x generation speed improvement :P
Owner
There was a problem hiding this comment.
- What are the benefits of this? I'm not immediately seeing any.
- This change is highly unreadable. Adding so much mutable-at-runtime code is rarely a good idea...
- What is the entire brouhaha about node comparison??? I ran tests and I have never seen any single comparison performed in them.
==here is a convenience method, not a core method; if you are seeing many calls to it, that means you are using this library incorrectly.
chriscz
reviewed
Aug 2, 2023
| other.is_a?(self.class) && | ||
| obtain_class_variable(:@@ooxml_attributes).all? { |k, v| self.send(v[:accessor]) == other.send(v[:accessor]) } && | ||
| obtain_class_variable(:@@ooxml_child_nodes).all? { |k, v| self.send(v[:accessor]) == other.send(v[:accessor]) } | ||
| self.hash == other.hash |
There was a problem hiding this comment.
Just because the hashes are equal does not mean the attributes are equal.
You will still need to do the comparison of attributes when the hashes are equal, the alternative may be to use SHA512 hashes or something.
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.
Related to #267
Improve performance using Merkle tree on XML node for equality comparison instead of per-field equality.
This can improve hugely the rendering of an excel with a lot of differents styles (fonts, border etc...), by 2 or 3 magnitudes on my production's company reports.