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

Speed up JSON::Validator.validate #255

Closed
wants to merge 9 commits into from

Commits on May 14, 2015

  1. Speed up JSON::Validator.validate

    Addressible's URI parsing shows up at the top of the profiler for our use case.
    
    This patch adds a cache to JSON::Util::URI.normalized_uri, to trade CPU time for memory.
    
    There are other expensive Addressible methods that should be cached elsewhere.
    
    benchmark: https://github.com/mjc/json-schema-perf
    
    MRI 2.2.2 before: 825.363  (± 6.2%) i/s
    MRI 2.2.2 after:  1.436k (± 4.5%) i/s
    
    1.74x faster
    
    JRuby 1.7.20 before: 1.445k (± 2.5%) i/s
    JRuby 1.7.20 after: 2.272k (± 6.1%) i/s
    
    1.57x faster
    mjc committed May 14, 2015
    Configuration menu
    Copy the full SHA
    078f745 View commit details
    Browse the repository at this point in the history

Commits on May 18, 2015

  1. Configuration menu
    Copy the full SHA
    6c26bf5 View commit details
    Browse the repository at this point in the history

Commits on May 19, 2015

  1. Configuration menu
    Copy the full SHA
    6687747 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0807525 View commit details
    Browse the repository at this point in the history

Commits on May 20, 2015

  1. Don't update url fragment if it's already blank or nil

    Addressable::URI#fragment= triggers a revalidation of the URL,
    which is super slow.  Don't do this when it isn't necessary.
    mjc committed May 20, 2015
    Configuration menu
    Copy the full SHA
    c108723 View commit details
    Browse the repository at this point in the history
  2. Cache Addressable::URI.parse also

    mjc committed May 20, 2015
    Configuration menu
    Copy the full SHA
    ac24f48 View commit details
    Browse the repository at this point in the history

Commits on May 21, 2015

  1. Revert "Cache Addressable::URI.parse also"

    This reverts commit ac24f48.
    mjc committed May 21, 2015
    Configuration menu
    Copy the full SHA
    4365f88 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b25cd15 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2015

  1. Configuration menu
    Copy the full SHA
    8d996e1 View commit details
    Browse the repository at this point in the history