jiter icon indicating copy to clipboard operation
jiter copied to clipboard

faster creation of `PyList`

Open samuelcolvin opened this issue 1 year ago • 7 comments

samuelcolvin avatar Mar 28 '24 23:03 samuelcolvin

CodSpeed Performance Report

Merging #74 will not alter performance

Comparing fast-pylist (6e80788) with main (f6b698e)

Summary

✅ 59 untouched benchmarks

codspeed-hq[bot] avatar Mar 28 '24 23:03 codspeed-hq[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 95.11%. Comparing base (37f9138) to head (6e80788). Report is 60 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #74      +/-   ##
==========================================
- Coverage   96.59%   95.11%   -1.49%     
==========================================
  Files           9       10       +1     
  Lines        1294     1494     +200     
==========================================
+ Hits         1250     1421     +171     
- Misses         44       73      +29     
Files with missing lines Coverage Δ
src/python.rs 97.18% <100.00%> (+0.26%) :arrow_up:

... and 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

codecov[bot] avatar Mar 28 '24 23:03 codecov[bot]

This makes a substantial difference locally, but codspeed seems to disagree

image

???

samuelcolvin avatar Mar 28 '24 23:03 samuelcolvin

Is "locally" arm or x86_64? Might differ greatly between the two platforms.

TBH I'm ok with this but I also just think that really PyO3 should be reworking its list constructor to allow this.

davidhewitt avatar Mar 30 '24 19:03 davidhewitt

Locally was macos.

samuelcolvin avatar Mar 30 '24 19:03 samuelcolvin

Not clear there's an improvement on x86, might even be worse (although I have no idea how it could be):

image

So I'll leave this, we can either reconsider or close.

samuelcolvin avatar Apr 02 '24 11:04 samuelcolvin

I think better is that I aim to fix PyO3 to avoid needless reference count operations. Would be a modest speedup for quite a few operations / smaller binary size :)

davidhewitt avatar Apr 02 '24 12:04 davidhewitt

PyO3 0.23 (#137) has a new IntoPyObject trait which optimises transfer of reference counts, will close this.

davidhewitt avatar Nov 15 '24 19:11 davidhewitt