Skip to content

Conversation

jakobnissen
Copy link
Contributor

The small dependency SnoopPrecompile helps precompilation, while itself having
little impact on latency.
With this change, JSON3 precompiles significantly better.

This change increases time spent on using, but decreases inference time for any of the workloads in the workload.jl file.

Here are timings for a script which loads JSON3 and executs the same workload in workload.jl file on master vs this PR:

# Master
Benchmark 1: julia --project=. --startup=no /tmp/foo.jl
  Time (mean ± σ):      3.531 s ±  0.065 s    [User: 3.537 s, System: 0.580 s]
  Range (min … max):    3.453 s …  3.697 s    10 runs

# PR
Benchmark 1: julia --project=. --startup=no /tmp/foo.jl
  Time (mean ± σ):      2.149 s ±  0.031 s    [User: 2.195 s, System: 0.554 s]
  Range (min … max):    2.099 s …  2.206 s    10 runs

@quinnj I'm not sure the workload covers all the common use-cases of JSON3, i.e. whether the workload ends up calling all the methods a user would typically call.

The small dependency SnoopPrecompile helps precompilation, while itself having
little impact on latency.
With this change, JSON3 precompiles significantly better.
@jakobnissen
Copy link
Contributor Author

The workload from #210 is cut from 1.94s to 1.20s after this change.

@jakobnissen
Copy link
Contributor Author

@quinnj is it possible to merge this? The precise SnoopPrecompile statements can easily be updated later.

@codecov
Copy link

codecov bot commented Oct 20, 2022

Codecov Report

Base: 88.36% // Head: 88.30% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (bd1b5a2) compared to base (3d542d3).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #228      +/-   ##
==========================================
- Coverage   88.36%   88.30%   -0.06%     
==========================================
  Files           9        9              
  Lines        1710     1710              
==========================================
- Hits         1511     1510       -1     
- Misses        199      200       +1     
Impacted Files Coverage Δ
src/JSON3.jl 100.00% <ø> (ø)
src/strings.jl 98.91% <0.00%> (-1.09%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@quinnj quinnj merged commit 9f9c1db into quinnj:main Oct 20, 2022
@jakobnissen jakobnissen deleted the snoop branch October 22, 2022 13:51
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.

2 participants