Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance fixes #19

Merged
merged 4 commits into from Sep 30, 2015
Merged

Conversation

jperville
Copy link
Member

This PR contains several small performance fixes for json-ld.

The optimizations consist in:

  • applying recommendation of 'fasterer' gem (here Hash#each_key faster than Hash#keys.each)
  • removal of unused code in JSON::LD::Utils#debug that was executed even when debug is not on
  • refactoring expensive Array intersection in JSON::LD::Utils.node? for several Hash#has_key? calls
  • reduce allocation of Hashes by using Hash#merge! instead of Hash#merge when appropriate and safe

The specs still pass after all these changes.

@jperville
Copy link
Member Author

This PR is the companion of ruby-rdf/rdf#213.

gkellogg added a commit that referenced this pull request Sep 30, 2015
@gkellogg gkellogg merged commit b649383 into ruby-rdf:develop Sep 30, 2015
@gkellogg
Copy link
Member

Cool, thanks.

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.

None yet

2 participants