Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: python-jsonschema/jsonschema
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.21.0
Choose a base ref
...
head repository: python-jsonschema/jsonschema
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.21.1
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Jan 19, 2024

  1. perf -> bench

    Julian committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    c9e2029 View commit details
    Browse the repository at this point in the history
  2. Slightly speed up the contains keyword.

    Saves some unnecessary repeated validator re-creation while validating
    arrays.
    
    In a quick benchmark (added here) and on my local machine (an M2 Mini)
    this goes from:
    
        ```
        baseline: Mean +- std dev: 3.55 us +- 0.04 us
        beginning: Mean +- std dev: 3.37 ms +- 0.02 ms
        middle: Mean +- std dev: 3.37 ms +- 0.03 ms
        end: Mean +- std dev: 3.36 ms +- 0.02 ms
        invalid: Mean +- std dev: 3.40 ms +- 0.02 ms
        ```
    to:
    
        ```
        baseline: Mean +- std dev: 4.27 us +- 0.05 us
        beginning: Mean +- std dev: 2.65 ms +- 0.01 ms
        middle: Mean +- std dev: 2.66 ms +- 0.02 ms
        end: Mean +- std dev: 2.67 ms +- 0.02 ms
        invalid: Mean +- std dev: 2.70 ms +- 0.02 ms
        ```
    
    on the included example (synthetic of course, but not ridiculously so).
    
    (The lack of difference in timing for how far into the array we get
    before finding a match seems interesting but probably requires a
    benchmark with a more interesting subschema we're matching on).
    Julian committed Jan 19, 2024
    Configuration menu
    Copy the full SHA
    aa53fd0 View commit details
    Browse the repository at this point in the history
Loading