JuliaLang / TOML.jl

A fast TOML parser for TOML 1.0 written in Julia
MIT License
34 stars 15 forks source link

Tighten array type and add benchmarks #4

Closed KristofferC closed 4 years ago

KristofferC commented 4 years ago

Benchmarks:

ID time GC time memory allocations
["array of tables", "empty"] 13.140 ms (5%) 8.37 MiB (1%) 80040
["arrays", "heterogeneous"] 10.100 ms (5%) 5.30 MiB (1%) 100040
["arrays", "homogeneous"] 9.475 ms (5%) 5.05 MiB (1%) 100036
["numbers", "floats"] 21.664 ms (5%) 6.58 MiB (1%) 200036
["numbers", "integers"] 21.808 ms (5%) 6.58 MiB (1%) 200036
["parse empty"] 267.926 ns (5%) 2.02 KiB (1%) 16
["registry", "Compat.toml"] 59.320 μs (5%) 35.80 KiB (1%) 431
["registry", "Registry.toml"] 3.642 ms (5%) 3.87 MiB (1%) 37025
["strings", "long"] 2.359 ms (5%) 978.86 KiB (1%) 20
["strings", "short"] 788.885 μs (5%) 571.39 KiB (1%) 10034

After an optimization:

ID time GC time memory allocations
["array of tables", "empty"] 13.319 ms (5%) 8.37 MiB (1%) 80040
["arrays", "heterogeneous"] 9.833 ms (5%) 2.25 MiB (1%) 39
["arrays", "homogeneous"] 9.178 ms (5%) 2.00 MiB (1%) 36
["numbers", "floats"] 20.414 ms (5%) 3.53 MiB (1%) 100036
["numbers", "integers"] 21.042 ms (5%) 3.53 MiB (1%) 100036
["parse empty"] 250.718 ns (5%) 2.02 KiB (1%) 16
["registry", "Compat.toml"] 62.436 μs (5%) 35.80 KiB (1%) 431
["registry", "Registry.toml"] 3.665 ms (5%) 3.87 MiB (1%) 37025
["strings", "long"] 2.256 ms (5%) 978.86 KiB (1%) 20
["strings", "short"] 756.360 μs (5%) 571.39 KiB (1%) 10034
codecov-commenter commented 4 years ago

Codecov Report

Merging #4 into master will increase coverage by 0.22%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
+ Coverage   88.12%   88.34%   +0.22%     
==========================================
  Files           3        3              
  Lines         581      592      +11     
==========================================
+ Hits          512      523      +11     
  Misses         69       69              
Impacted Files Coverage Δ
src/parser.jl 88.00% <100.00%> (+0.26%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 02576a7...28fd8b1. Read the comment docs.