jiter icon indicating copy to clipboard operation
jiter copied to clipboard

convert skip to iterate instead of call recursive functions

Open davidhewitt opened this issue 1 year ago • 2 comments

The observation is that "skip" functionality shouldn't be hard to avoid function recursion because the return type is always (). So here's an attempted implementation. Should hopefully be faster...

davidhewitt avatar May 29 '24 16:05 davidhewitt

CodSpeed Performance Report

Merging #111 will improve performances by 66.7%

Comparing dh/iter-skip (aa6b268) with main (366d16a)

Summary

⚡ 4 improvements ✅ 69 untouched benchmarks

Benchmarks breakdown

Benchmark main dh/iter-skip Change
big_jiter_skip 19.6 ms 17.5 ms +11.87%
pass2_jiter_skip 3.5 µs 2.1 µs +66.7%
short_numbers_jiter_skip 61 µs 55.1 µs +10.7%
x100_jiter_skip 1.3 µs 1.2 µs +10.11%

codspeed-hq[bot] avatar May 29 '24 16:05 codspeed-hq[bot]

Codecov Report

Attention: Patch coverage is 89.47368% with 6 lines in your changes are missing coverage. Please review.

Files Patch % Lines
crates/jiter/src/value.rs 89.47% 6 Missing :warning:

:loudspeaker: Thoughts on this report? Let us know!

codecov[bot] avatar May 29 '24 16:05 codecov[bot]

This is great, thank you.

samuelcolvin avatar May 31 '24 12:05 samuelcolvin