Skip to content

Instantly share code, notes, and snippets.

@nascheme
Last active April 11, 2026 20:31
Show Gist options
  • Select an option

  • Save nascheme/c85c46d84b6739305ea071df4d887a57 to your computer and use it in GitHub Desktop.

Select an option

Save nascheme/c85c46d84b6739305ea071df4d887a57 to your computer and use it in GitHub Desktop.
Comparing generational vs incremental GC in 3.14, with fastbench
base: d76c56e958c9a603ded42d27b39ab51c1e3794e4 (head of 3.14 branch)
gen_gc: https://github.com/nascheme/cpython/tree/gc-gen-3.14 (b4ea6d82324cf84f74731a88decd7577eccde2f9)
inc_gc: as above but with -Xinc_gc on
Benchmark results produced by "fastbench" 2ab489f1f315582b8a537b537a7664898d90a0a4
Benchmark base ms gen_gc ms ratio inc_gc ms ratio
------------------------------------------------------------------------------------------------
2to3 95.2 96.6 1.015 97.7 1.026
async_generators 157.4 161.8 1.028 164.1 1.043
async_tree_cpu_io_mixed 265.0 301.1 1.136 272.2 1.027
async_tree_cpu_io_mixed_tg 254.4 310.0 1.219 252.7 0.993
async_tree_io 269.7 417.2 1.547 289.7 1.074
async_tree_io_tg 273.6 407.1 1.488 300.4 1.098
async_tree_memoization 158.3 210.5 1.330 134.3 0.848
async_tree_memoization_tg 154.9 231.7 1.495 158.5 1.023
async_tree_none 132.5 146.8 1.107 114.6 0.864
async_tree_none_tg 105.8 158.4 1.497 120.3 1.137
asyncio_websockets 204.4 202.6 0.991 201.4 0.985
bpe_tokeniser 167.6 163.4 0.975 171.7 1.025
chaos 101.8 100.6 0.988 102.2 1.003
comprehensions 96.5 99.0 1.026 100.2 1.038
coroutines 88.9 96.5 1.086 92.6 1.042
coverage 7.9 8.0 1.012 8.1 1.014
create_gc_cycles 111.2 108.2 0.973 105.1 0.946
crypto_pyaes 111.3 107.3 0.964 107.4 0.965
deepcopy 98.7 98.9 1.001 99.7 1.010
deepcopy_memo 85.9 86.6 1.008 86.3 1.004
deepcopy_reduce 104.7 97.3 0.929 103.8 0.991
deltablue 95.2 94.4 0.991 96.8 1.016
docutils 98.9 96.1 0.971 97.0 0.980
dulwich_log 146.4 145.1 0.991 148.9 1.017
fannkuch 163.9 165.8 1.012 175.0 1.068
float 88.0 95.7 1.087 86.9 0.987
gc_traversal 118.4 100.8 0.851 109.6 0.926
generators 94.7 95.3 1.007 93.9 0.992
genshi_text 100.5 100.4 0.998 100.8 1.003
genshi_xml 96.5 96.1 0.995 97.0 1.005
go 54.3 54.2 0.998 61.0 1.125
hexiom 90.7 92.4 1.019 92.0 1.015
html5lib 86.0 88.7 1.031 85.9 0.999
json_dumps 77.1 76.8 0.996 78.8 1.022
json_loads 83.4 85.0 1.020 85.1 1.020
logging_format 101.2 101.7 1.005 101.7 1.005
logging_silent 92.7 92.6 0.998 94.3 1.017
logging_simple 101.0 98.2 0.972 99.4 0.984
mako 81.2 81.3 1.000 81.4 1.002
many_optionals 100.7 94.6 0.940 101.2 1.005
mdp 263.1 280.3 1.065 264.9 1.007
meteor_contest 122.4 118.4 0.967 121.0 0.988
nbody 77.8 76.8 0.988 77.8 1.000
nqueens 123.4 122.0 0.989 126.2 1.022
pathlib 86.6 86.8 1.003 86.8 1.003
pickle_pure_python 95.4 97.3 1.019 97.0 1.016
pidigits 125.0 125.2 1.002 125.1 1.001
pprint_pformat 70.9 67.2 0.948 68.9 0.973
pprint_safe_repr 100.0 98.0 0.980 100.3 1.003
pyflate 187.1 188.7 1.009 189.6 1.014
raytrace 114.9 117.7 1.024 116.4 1.013
regex_compile 119.5 118.5 0.992 119.0 0.996
regex_dna 100.2 102.0 1.018 101.4 1.012
regex_effbot 102.0 102.8 1.009 103.0 1.010
regex_v8 91.5 91.9 1.004 92.3 1.008
richards 92.6 92.7 1.001 93.1 1.005
richards_super 84.7 87.4 1.032 87.1 1.029
scimark_fft 129.4 126.3 0.976 126.5 0.978
scimark_lu 81.2 81.5 1.005 80.8 0.995
scimark_monte_carlo 81.4 76.5 0.940 76.5 0.940
scimark_sor 82.4 82.0 0.995 82.3 0.999
scimark_sparse_mat_mult 94.5 95.6 1.011 95.1 1.006
spectral_norm 77.3 78.3 1.013 77.3 1.000
sqlalchemy_declarative 126.0 126.2 1.002 126.3 1.002
sqlalchemy_imperative 100.3 99.4 0.991 100.1 0.999
sqlglot_normalize 105.9 103.3 0.975 104.9 0.990
sqlglot_optimize 103.0 103.4 1.004 103.2 1.002
sqlglot_parse 87.9 92.9 1.056 88.6 1.007
sqlglot_transpile 101.8 96.2 0.945 102.7 1.009
sqlite_synth 96.3 97.1 1.009 98.8 1.026
subparsers 50.8 46.7 0.920 52.3 1.029
sympy_expand 201.0 201.9 1.004 201.1 1.000
sympy_integrate 117.3 116.4 0.992 115.7 0.987
sympy_str 105.9 105.7 0.999 105.1 0.993
sympy_sum 95.1 96.0 1.010 95.6 1.005
telco 101.9 101.6 0.997 108.4 1.064
tomli_loads 90.4 91.1 1.007 89.2 0.986
typing_runtime_protocols 104.9 107.5 1.025 110.9 1.058
unpickle_pure_python 86.6 86.9 1.003 88.4 1.021
xml_etree_generate 83.2 71.0 0.853 81.6 0.980
xml_etree_iterparse 87.9 115.3 1.311 87.8 0.998
xml_etree_parse 79.6 103.3 1.297 80.1 1.005
xml_etree_process 85.8 75.0 0.874 85.7 0.999
------------------------------------------------------------------------------------------------
SCORE 23741.3 23077.3 0.972 23610.8 0.995
ratio < 1.0 = faster than base, > 1.0 = slower than base
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment