Skip to content

Julia remove globals#115

Merged
DmitrySoshnikov merged 2 commits into
DmitrySoshnikov:masterfrom
davidmclifton:julia-remove-globals
Apr 1, 2022
Merged

Julia remove globals#115
DmitrySoshnikov merged 2 commits into
DmitrySoshnikov:masterfrom
davidmclifton:julia-remove-globals

Conversation

@davidmclifton

Copy link
Copy Markdown
Contributor

Removed non-static globals and put them in a structure which is passed, so should not be multithreading safe. Also did some performance optimizations.

Results of optimizations are:

BEFORE:

julia> @benchmark SyntaxParser.parse("5 + 5")
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
Range (min … max): 18.917 μs … 2.400 ms ┊ GC (min … max): 0.00% … 98.15%
Time (median): 20.500 μs ┊ GC (median): 0.00%
Time (mean ± σ): 22.406 μs ± 63.097 μs ┊ GC (mean ± σ): 7.87% ± 2.77%

Memory estimate: 37.61 KiB, allocs estimate: 200.

AFTER:

julia> @benchmark SyntaxParser.parse("5 + 5")
BenchmarkTools.Trial: 10000 samples with 3 evaluations.
Range (min … max): 8.361 μs … 874.167 μs ┊ GC (min … max): 0.00% … 98.16%
Time (median): 9.833 μs ┊ GC (median): 0.00%
Time (mean ± σ): 11.513 μs ± 35.497 μs ┊ GC (mean ± σ): 13.35% ± 4.27%

Memory estimate: 28.77 KiB, allocs estimate: 96.

@DmitrySoshnikov

Copy link
Copy Markdown
Owner

Perfect, thanks!

@DmitrySoshnikov DmitrySoshnikov merged commit 19a2aa2 into DmitrySoshnikov:master Apr 1, 2022
@davidmclifton davidmclifton deleted the julia-remove-globals branch April 1, 2022 17:32
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