-
Notifications
You must be signed in to change notification settings - Fork 344
Comparing changes
Open a pull request
base repository: ruby/json
base: 49650f7
head repository: ruby/json
compare: d5e4a6e
- 20 commits
- 10 files changed
- 6 contributors
Commits on Nov 6, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 447a718 - Browse repository at this point
Copy the full SHA 447a718View commit details -
Merge pull request #695 from MSP-Greg/00-ci-fix
CI: ci.yml - update to actions/checkout@v4
Configuration menu - View commit details
-
Copy full SHA for eb6de2f - Browse repository at this point
Copy the full SHA eb6de2fView commit details
Commits on Nov 7, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0d5ac5b - Browse repository at this point
Copy the full SHA 0d5ac5bView commit details -
Merge pull request #699 from ruby/add-dependabot-yaml
Added automated update workflow for GitHub Actions
Configuration menu - View commit details
-
Copy full SHA for 4c2433d - Browse repository at this point
Copy the full SHA 4c2433dView commit details -
Mark parser.c and Parser.java as generated files
This way they're hidden in diffs. It would be good to enforce on CI that the generated files match the source change, however ragel's output isn't consistent across versions and system, so we'll have to rely on changes being noticed by further contributions.
Configuration menu - View commit details
-
Copy full SHA for 42bc089 - Browse repository at this point
Copy the full SHA 42bc089View commit details -
Merge pull request #700 from casperisfine/mark-generated-files
Mark parser.c and Parser.java as generated files
Configuration menu - View commit details
-
Copy full SHA for 1ecf7b4 - Browse repository at this point
Copy the full SHA 1ecf7b4View commit details -
Reduce comparisons when parsing numbers
Before this commit, we would try to scan for a float, then if that failed, scan for an integer. But floats and integers have many bytes in common, so we would end up scanning the same bytes multiple times. This patch combines integer and float scanning machines so that we only have to scan bytes once. If the machine finds "float parts", then it executes the "isFloat" transition in the machine, which sets a boolean letting us know that the parser found a float. If we didn't find a float, but we did match, then we know it's an int.
Configuration menu - View commit details
-
Copy full SHA for 0c0e093 - Browse repository at this point
Copy the full SHA 0c0e093View commit details -
Configuration menu - View commit details
-
Copy full SHA for e51e796 - Browse repository at this point
Copy the full SHA e51e796View commit details -
Merge pull request #698 from ruby/float-parsing
Reduce comparisons when parsing numbers
Configuration menu - View commit details
-
Copy full SHA for 4be55b0 - Browse repository at this point
Copy the full SHA 4be55b0View commit details -
JSON.load_file: explictly load the file as UTF-8
Fix: #697 This way even if `Encoding.default_external` is set to a weird value the document will be parsed just fine.
Configuration menu - View commit details
-
Copy full SHA for 3a8505a - Browse repository at this point
Copy the full SHA 3a8505aView commit details -
Merge pull request #702 from casperisfine/load-file-utf8
JSON.load_file: explictly load the file as UTF-8
Configuration menu - View commit details
-
Copy full SHA for b1397e2 - Browse repository at this point
Copy the full SHA b1397e2View commit details
Commits on Nov 8, 2024
-
Benchmark
Oj::Parser
in a thread safe wayThe documentation state `Oj::Parser.usual` isn't thread safe: https://github.com/ohler55/oj/blob/c70bf4125b546bc7146840b15de36460d42b4dff/ext/oj/parser.c#L1507-L1513 As such we shouldn't benchark it this way, but instantiate a new parser every time. Technically in real world scenarios you could create a pool of parsers and re-use them, but if it's not provided by the gem, I'm not sure we should go out of our way to do it.
Configuration menu - View commit details
-
Copy full SHA for 855563f - Browse repository at this point
Copy the full SHA 855563fView commit details -
Merge pull request #703 from casperisfine/oj-parser-thread-safe
Benchmark `Oj::Parser` in a thread safe way
Configuration menu - View commit details
-
Copy full SHA for 821b92e - Browse repository at this point
Copy the full SHA 821b92eView commit details
Commits on Nov 11, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 6ae9155 - Browse repository at this point
Copy the full SHA 6ae9155View commit details -
Merge pull request #704 from tompng/test_verbose_fix
Fix $VERBOSE restore
Configuration menu - View commit details
-
Copy full SHA for 3a09ad1 - Browse repository at this point
Copy the full SHA 3a09ad1View commit details
Commits on Nov 13, 2024
-
Only use the key cache if the Hash is in an Array
Otherwise the likeliness of seeing that key again is really low, and looking up the cache is just a waste. Before: ``` == Parsing small hash (65 bytes) ruby 3.4.0dev (2024-11-13T12:32:57Z fstr-update-callba.. 9b44b455b3) +YJIT +PRISM [arm64-darwin24] Warming up -------------------------------------- json 343.049k i/100ms oj 213.943k i/100ms Oj::Parser 31.583k i/100ms rapidjson 303.433k i/100ms Calculating ------------------------------------- json 3.704M (± 1.5%) i/s (270.01 ns/i) - 18.525M in 5.003078s oj 2.200M (± 1.1%) i/s (454.46 ns/i) - 11.125M in 5.056526s Oj::Parser 285.369k (± 4.8%) i/s (3.50 μs/i) - 1.453M in 5.103866s rapidjson 3.216M (± 1.6%) i/s (310.95 ns/i) - 16.082M in 5.001973s Comparison: json: 3703517.4 i/s rapidjson: 3215983.0 i/s - 1.15x slower oj: 2200417.1 i/s - 1.68x slower Oj::Parser: 285369.1 i/s - 12.98x slower == Parsing test from oj (258 bytes) ruby 3.4.0dev (2024-11-13T12:32:57Z fstr-update-callba.. 9b44b455b3) +YJIT +PRISM [arm64-darwin24] Warming up -------------------------------------- json 54.539k i/100ms oj 41.473k i/100ms Oj::Parser 24.064k i/100ms rapidjson 51.466k i/100ms Calculating ------------------------------------- json 549.386k (± 1.6%) i/s (1.82 μs/i) - 2.781M in 5.064316s oj 417.003k (± 1.3%) i/s (2.40 μs/i) - 2.115M in 5.073047s Oj::Parser 226.500k (± 4.7%) i/s (4.42 μs/i) - 1.131M in 5.005466s rapidjson 526.124k (± 1.0%) i/s (1.90 μs/i) - 2.676M in 5.087176s Comparison: json: 549385.6 i/s rapidjson: 526124.3 i/s - 1.04x slower oj: 417003.4 i/s - 1.32x slower Oj::Parser: 226500.4 i/s - 2.43x slower ``` After: ``` == Parsing small hash (65 bytes) ruby 3.4.0dev (2024-11-13T12:32:57Z fstr-update-callba.. 9b44b455b3) +YJIT +PRISM [arm64-darwin24] Warming up -------------------------------------- json 361.394k i/100ms oj 217.203k i/100ms Oj::Parser 28.855k i/100ms rapidjson 303.404k i/100ms Calculating ------------------------------------- json 3.859M (± 2.9%) i/s (259.13 ns/i) - 19.515M in 5.061302s oj 2.191M (± 1.6%) i/s (456.49 ns/i) - 11.077M in 5.058043s Oj::Parser 315.132k (± 7.1%) i/s (3.17 μs/i) - 1.587M in 5.065707s rapidjson 3.156M (± 4.0%) i/s (316.88 ns/i) - 15.777M in 5.008949s Comparison: json: 3859046.5 i/s rapidjson: 3155778.5 i/s - 1.22x slower oj: 2190616.0 i/s - 1.76x slower Oj::Parser: 315132.4 i/s - 12.25x slower == Parsing test from oj (258 bytes) ruby 3.4.0dev (2024-11-13T12:32:57Z fstr-update-callba.. 9b44b455b3) +YJIT +PRISM [arm64-darwin24] Warming up -------------------------------------- json 55.682k i/100ms oj 40.343k i/100ms Oj::Parser 25.119k i/100ms rapidjson 51.500k i/100ms Calculating ------------------------------------- json 555.808k (± 1.4%) i/s (1.80 μs/i) - 2.784M in 5.010092s oj 412.283k (± 1.7%) i/s (2.43 μs/i) - 2.098M in 5.089900s Oj::Parser 279.306k (±13.3%) i/s (3.58 μs/i) - 1.356M in 5.022079s rapidjson 517.177k (± 2.7%) i/s (1.93 μs/i) - 2.626M in 5.082352s Comparison: json: 555808.3 i/s rapidjson: 517177.1 i/s - 1.07x slower oj: 412283.2 i/s - 1.35x slower Oj::Parser: 279306.5 i/s - 1.99x slower ```
Configuration menu - View commit details
-
Copy full SHA for 00c45dd - Browse repository at this point
Copy the full SHA 00c45ddView commit details -
Merge pull request #705 from casperisfine/key-cache-in-array-only
Only use the key cache if the Hash is in an Array
Configuration menu - View commit details
-
Copy full SHA for d0dae8f - Browse repository at this point
Copy the full SHA d0dae8fView commit details
Commits on Nov 14, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 61f022d - Browse repository at this point
Copy the full SHA 61f022dView commit details -
Merge pull request #706 from YuheiNakasaka/fix-redundant-to_str
Fix redundant to_str call in JSON.[] method
Configuration menu - View commit details
-
Copy full SHA for 72bea9d - Browse repository at this point
Copy the full SHA 72bea9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for d5e4a6e - Browse repository at this point
Copy the full SHA d5e4a6eView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 49650f7...d5e4a6e