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

Compatibility with external deep proxies #39

Closed
wants to merge 11 commits into from
Closed

Compatibility with external deep proxies #39

wants to merge 11 commits into from

Commits on Jun 6, 2019

  1. Configuration menu
    Copy the full SHA
    2e41ca8 View commit details
    Browse the repository at this point in the history
  2. more DRYness in tests

    use a one liner to clone the object where possible
    warpech committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    fb30a53 View commit details
    Browse the repository at this point in the history
  3. refactor tree metadata access

    - changed _treeMetadataMap to use the unproxified version of the tree, instead of proxified
    - merged _parenthoodMap into _treeMetadataMap
    - added a new symbol _metadataSymbol used to access the metadata from the proxified object, but only if you have a reference to the symbol
    warpech committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    edb513a View commit details
    Browse the repository at this point in the history
  4. handle external proxification (#53)

    skip generation of a replace operation, if an object within the tree is replaced with a proxified version of itself by external code
    warpech committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    c461b49 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3678f47 View commit details
    Browse the repository at this point in the history
  6. breaking change in benchmark: DRY fixtures

    Warning, this commit changes the performance of the benchmark. Generation of tested object is now 2x faster. This is good for the benchmark, because cheaper object generation allows the benchmark to be more sensitive in catching the differences in the performance of JSONPatcherProxy.
    
    Just remember that the results from before and after this commit are not comparable.
    
    Benchmark results before this commit
    =============================
    jsonpatcherproxy generate operation
     Ops/sec: 132404 ±2.55% Ran 8276 times in 0.063 seconds.
    jsonpatch generate operation
     Ops/sec: 106585 ±6.73% Ran 6434 times in 0.060 seconds.
    jsonpatcherproxy mutation - huge object
     Ops/sec: 906 ±2.45% Ran 51 times in 0.056 seconds.
    jsonpatch mutation - huge object
     Ops/sec: 862 ±1.52% Ran 47 times in 0.055 seconds.
    jsonpatcherproxy generate operation - huge object
     Ops/sec: 811 ±1.99% Ran 46 times in 0.057 seconds.
    jsonpatch generate operation - huge object
     Ops/sec: 847 ±1.20% Ran 47 times in 0.055 seconds.
    PROXIFY big object
     Ops/sec: 1813 ±2.00% Ran 102 times in 0.056 seconds.
    DIRTY-OBSERVE big object
     Ops/sec: 1625 ±1.48% Ran 91 times in 0.056 seconds.
    
    Benchmark results after this commit
    =============================
    jsonpatcherproxy generate operation
     Ops/sec: 136915 ±2.46% Ran 8566 times in 0.063 seconds.
    jsonpatch generate operation
     Ops/sec: 104113 ±7.19% Ran 6330 times in 0.061 seconds.
    jsonpatcherproxy mutation - huge object
     Ops/sec: 1960 ±3.53% Ran 130 times in 0.066 seconds.
    jsonpatch mutation - huge object
     Ops/sec: 1607 ±1.84% Ran 88 times in 0.055 seconds.
    jsonpatcherproxy generate operation - huge object
     Ops/sec: 1562 ±3.40% Ran 101 times in 0.065 seconds.
    jsonpatch generate operation - huge object
     Ops/sec: 1620 ±2.04% Ran 90 times in 0.056 seconds.
    PROXIFY big object
     Ops/sec: 3968 ±4.07% Ran 294 times in 0.074 seconds.
    DIRTY-OBSERVE big object
     Ops/sec: 3285 ±1.83% Ran 180 times in 0.055 seconds.
    warpech committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    bcde61c View commit details
    Browse the repository at this point in the history
  7. rewrite the benchmark

    the benchmark methods are almost exactly the same, but I have made the following changes:
    - group benchmarks by the topic
    - give more meaningful titles
    - wherever the preparation code is not meaningful for the benchmark, move it outside the benchmark
    - use code blocks to give scope to preparation variables
    
    this is a change that makes the benchmark results incomparable with the previous versions.
    
    however, it will work if you copy this file onto an older version and run it.
    warpech committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    67cc6f5 View commit details
    Browse the repository at this point in the history
  8. add benchmark for getting data from the observed object

    as requested in #39 (comment)
    
    the benchmark simply serializes the whole object, which triggers the "get" trap on every subtree
    warpech committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    6fd48b6 View commit details
    Browse the repository at this point in the history
  9. add CLI argument to include comparison with no-op and fast-json-patch

    by default such comparison will be excluded. Benefits of this:
    - faster execution
    - shorter report to copy to PRs
    warpech committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    8abd5b6 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2019

  1. add "generate" as the last step in the benchmarks

    to make functionality equal to fast-json-patch'es
    warpech committed Jun 7, 2019
    Configuration menu
    Copy the full SHA
    44d43f2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f9d6567 View commit details
    Browse the repository at this point in the history