Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for CPython 3.13 #225

Merged
merged 1 commit into from
Oct 13, 2024
Merged

feat: add support for CPython 3.13 #225

merged 1 commit into from
Oct 13, 2024

Conversation

P403n1x87
Copy link
Owner

@P403n1x87 P403n1x87 commented Jul 5, 2024

Description of the Change

We add support for CPython 3.13. This new version introduces a data structure designed for easily exposing the required field offsets to out-of-process tools like Austin, via the ABI. We adapt the coding to allow integrating with this new structure.

We currently limit testing to the CPython 3.13 version with the GIL. No testing has currently been done with either the free-threaded version, nor with the new JIT.

Alternate Designs

N.A.

Regressions

There are slim chances that the current approach taken fails under certain circumstances. That is because the new approach would require allocating memory for the Python data structures at runtime, as they are no longer known at compile time. This has been done for some of the more critical structures, but for others we are still relying on the size of the same structures from previous versions. There are no guarantees that this would work.

Verification Process

Existing test suite extended to Python 3.13.

@P403n1x87 P403n1x87 self-assigned this Jul 5, 2024
Copy link

codecov bot commented Jul 5, 2024

Codecov Report

Attention: Patch coverage is 78.78788% with 14 lines in your changes missing coverage. Please review.

Project coverage is 69.35%. Comparing base (741d378) to head (05875d0).
Report is 2 commits behind head on devel.

Files with missing lines Patch % Lines
src/py_proc.c 73.46% 7 Missing and 6 partials ⚠️
src/version.h 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel     #225      +/-   ##
==========================================
+ Coverage   68.89%   69.35%   +0.46%     
==========================================
  Files          27       27              
  Lines        2517     2568      +51     
  Branches      770      787      +17     
==========================================
+ Hits         1734     1781      +47     
- Misses        448      452       +4     
  Partials      335      335              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jul 5, 2024

Austin Benchmarks

Running Austin benchmarks with Python 3.10.15

Benchmark Summary

Comparison of dev against 3.6.0.

The following scenarios show a statistically significant difference in performance between the two versions.

Sample Rate Saturation Error Rate Sampling Speed
Wall time [sampling interval: 10] 🟡 🟢 🟡 🟡
Multiprocess wall time [sampling interval: 10] 🟢 🟡 🟡 🟡
Multiprocess wall time [sampling interval: 100] 🟡 🔴 🟡 🟡

Benchmark Results

Wall time [sampling interval: 1]

Wall time [sampling interval: 1]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 104000 ± 1000 1 ± 0 1e-05 ± 1e-05 14.9 ± 0.6
dev 104000 ± 2000 1 ± 0 1.7e-05 ± 7e-06 14.6 ± 0.7
Wall time [sampling interval: 10]

Wall time [sampling interval: 10]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 100000 ± 4000 0.9 ± 0.01 1e-05 ± 1e-05 15.2 ± 0.4
dev 101000 ± 4000 0.85 ± 0.01 2.3e-05 ± 9e-06 15.2 ± 0.4
Wall time [sampling interval: 100]

Wall time [sampling interval: 100]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 12200 ± 200 0.0007 ± 0.0002 5e-05 ± 4e-05 16.8 ± 0.6
dev 12100 ± 200 0.0009 ± 0.0002 6e-05 ± 3e-05 16.6 ± 0.5
Wall time [sampling interval: 1000]

Wall time [sampling interval: 1000]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 1860 ± 20 0 ± 0 0.0001 ± 0.0002 18 ± 1
dev 1860 ± 40 0.0 ± 0.0001 0.0 ± 0.0001 20 ± 10
CPU time [sampling interval: 1]

CPU time [sampling interval: 1]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 30000 ± 2000 1 ± 0 5e-05 ± 4e-05 27 ± 1
dev 30000 ± 1000 1 ± 0 7e-05 ± 3e-05 27 ± 1
CPU time [sampling interval: 10]

CPU time [sampling interval: 10]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 30000 ± 1000 1 ± 0 5e-05 ± 4e-05 26.8 ± 0.9
dev 30000 ± 1000 1 ± 0 7e-05 ± 3e-05 26.8 ± 0.8
CPU time [sampling interval: 100]

CPU time [sampling interval: 100]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 6310 ± 10 0.002 ± 0.001 0.0002 ± 0.0001 30 ± 1
dev 6310 ± 20 0.003 ± 0.001 0.0002 ± 0.0001 31 ± 1
CPU time [sampling interval: 1000]

CPU time [sampling interval: 1000]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 946 ± 1 0 ± 0 0.0003 ± 0.0004 33 ± 2
dev 946 ± 1 0 ± 0 0.0001 ± 0.0003 34 ± 1
RSA keygen [sampling interval: 1]

RSA keygen [sampling interval: 1]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 32000 ± 2000 1 ± 0 0.0004 ± 0.0002 31 ± 2
dev 30000 ± 2000 1 ± 0 0.0005 ± 0.0003 33 ± 3
RSA keygen [sampling interval: 10]

RSA keygen [sampling interval: 10]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 31000 ± 2000 1 ± 0 0.0007 ± 0.0006 31 ± 3
dev 30000 ± 3000 1 ± 0 0.0005 ± 0.0003 33 ± 4
RSA keygen [sampling interval: 100]

RSA keygen [sampling interval: 100]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 6310 ± 20 0.02 ± 0.02 0.002 ± 0.001 36 ± 3
dev 6320 ± 40 0.03 ± 0.04 0.002 ± 0.002 39 ± 7
RSA keygen [sampling interval: 1000]

RSA keygen [sampling interval: 1000]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 943.3 ± 0.5 0 ± 0 0.004 ± 0.004 38 ± 2
dev 942 ± 2 0 ± 0 0.002 ± 0.003 40 ± 6
Full metrics [sampling interval: 1]

Full metrics [sampling interval: 1]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 39400 ± 800 1 ± 0 5e-05 ± 3e-05 38.4 ± 0.7
dev 39100 ± 700 1 ± 0 7e-05 ± 3e-05 38.4 ± 0.8
Full metrics [sampling interval: 10]

Full metrics [sampling interval: 10]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 39000 ± 1000 1 ± 0 4e-05 ± 4e-05 38.4 ± 0.5
dev 39200 ± 900 1 ± 0 6e-05 ± 3e-05 38.4 ± 0.8
Full metrics [sampling interval: 100]

Full metrics [sampling interval: 100]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 12200 ± 200 0.004 ± 0.0008 0.00012 ± 3e-05 44 ± 1
dev 12200 ± 300 0.005 ± 0.001 0.0002 ± 0.0001 44.4 ± 1.0
Full metrics [sampling interval: 1000]

Full metrics [sampling interval: 1000]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 1850 ± 30 0 ± 0 0.0002 ± 0.0002 48 ± 2
dev 1850 ± 30 0 ± 0 0.0003 ± 0.0003 48 ± 1
Multiprocess wall time [sampling interval: 1]

Multiprocess wall time [sampling interval: 1]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 3800 ± 500 1 ± 0 0.0002 ± 0.0001 230 ± 30
dev 4100 ± 200 1 ± 0 0.00026 ± 5e-05 230 ± 9
Multiprocess wall time [sampling interval: 10]

Multiprocess wall time [sampling interval: 10]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 3600 ± 700 1 ± 0 0.0002 ± 0.0001 232 ± 10
dev 4200 ± 300 1 ± 0 0.0003 ± 7e-05 220 ± 10
Multiprocess wall time [sampling interval: 100]

Multiprocess wall time [sampling interval: 100]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 3900 ± 400 0.034 ± 0.004 0.0002 ± 8e-05 234 ± 10
dev 3940 ± 80 0.038 ± 0.003 0.00027 ± 6e-05 240 ± 5
Multiprocess wall time [sampling interval: 1000]

Multiprocess wall time [sampling interval: 1000]

Sample Rate Saturation Error Rate Sampling Speed
3.6.0 3700 ± 300 0.008 ± 0.005 5e-05 ± 2e-05 110 ± 40
dev 3830 ± 60 0.0059 ± 0.0007 5e-05 ± 6e-05 90 ± 3

@P403n1x87 P403n1x87 force-pushed the feat/python313 branch 7 times, most recently from e66cdb1 to e224e5b Compare July 7, 2024 16:22
@P403n1x87 P403n1x87 force-pushed the feat/python313 branch 3 times, most recently from 8d2d690 to 8759211 Compare August 31, 2024 11:52
@P403n1x87 P403n1x87 force-pushed the feat/python313 branch 3 times, most recently from f15b9c6 to 9d76768 Compare October 12, 2024 20:42
@P403n1x87 P403n1x87 marked this pull request as ready for review October 12, 2024 21:06
@P403n1x87 P403n1x87 force-pushed the feat/python313 branch 4 times, most recently from a67e572 to 15a5441 Compare October 13, 2024 09:43
We add support for CPython 3.13
@P403n1x87 P403n1x87 added this to the Austin 3.7 milestone Oct 13, 2024
@P403n1x87 P403n1x87 merged commit dd5b67e into devel Oct 13, 2024
37 of 46 checks passed
@P403n1x87 P403n1x87 deleted the feat/python313 branch October 13, 2024 11:13
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