Skip to content

[WIP] Use CompactString as backing storage for Steel strings.#270

Open
wmedrano wants to merge 4 commits intomattwparas:masterfrom
wmedrano:master
Open

[WIP] Use CompactString as backing storage for Steel strings.#270
wmedrano wants to merge 4 commits intomattwparas:masterfrom
wmedrano:master

Conversation

@wmedrano
Copy link
Copy Markdown
Contributor

  • Use CompactString.
  • Benchmark.

@wmedrano
Copy link
Copy Markdown
Contributor Author

Here are the benchmark results I got.

TLDR: Seems a little bit better, but maybe not enough. May run again since results may be noisy. May also look into some string benchmarks.

Results

  • Ran the same benchmarks as CI.
  • Used diff --side-by-side --suppress-common-lines before.txt after.txt to filter output.
Before After Diff
test range-big ... bench: 82825 ns/iter (+/- 292) test range-big ... bench: 82320 ns/iter (+/- 334) -1%
test map-big ... bench: 465220 ns/iter (+/- 1583) test map-big ... bench: 433713 ns/iter (+/- 1897) -7%
test transducer-map ... bench: 1144534 ns/iter (+/- 3158) test transducer-map ... bench: 1071335 ns/iter (+/- 5610) -6%
test filter-big ... bench: 340884 ns/iter (+/- 3501) test filter-big ... bench: 331847 ns/iter (+/- 4115) -3%
test ten-thousand-iterations ... bench: 668004 ns/iter ( test ten-thousand-iterations ... bench: 600138 ns/iter ( -10%
test ten-thousand-iterations-letrec ... bench: 1173667 ns test ten-thousand-iterations-letrec ... bench: 1120359 ns -5%
test trie-sort-without-optimizations ... bench: 326192 n test trie-sort-without-optimizations ... bench: 335860 n +3%
test fib-28/fib-28 ... bench: 47478721 ns/iter (+/- 266770 test fib-28/fib-28 ... bench: 44984746 ns/iter (+/- 168274 -5%
test thread-creation/thread-creation ... bench: 1022818 n test thread-creation/thread-creation ... bench: 1034177 n +1%
test engine-creation ... bench: 18445246 ns/iter (+/- 1228 test engine-creation ... bench: 18327267 ns/iter (+/- 1816 -1%
test register-fn ... bench: 138 ns/iter (+/- 0) test register-fn ... bench: 146 ns/iter (+/- 0) +6%
test multiple-transducers ... bench: 6524 ns/iter (+/- test multiple-transducers ... bench: 6359 ns/iter (+/- -3%
bench: 336427485 ns/iter (+/- 4025646) bench: 331793506 ns/iter (+/- 3159865) -1%
test ackermann-3-3 ... bench: 272159 ns/iter (+/- 762) test ackermann-3-3 ... bench: 232964 ns/iter (+/- 1183) -14%

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.

1 participant