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

Speed up creating Mark objects in the Cython version #848

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bdraco
Copy link

@bdraco bdraco commented Feb 21, 2025

main 192,792,792ns
this PR 168,216,041ns

                            Benchmark Results                             
┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┓
┃             Benchmark ┃   Time (best) ┃ Rel. StdDev ┃ Run time ┃ Iters ┃
┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━┩
│ test_large_parse_yaml │ 192,792,792ns │        0.9% │    2.94s │    15 │
└───────────────────────┴───────────────┴─────────────┴──────────┴───────┘
                            Benchmark Results                             
┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━┓
┃             Benchmark ┃   Time (best) ┃ Rel. StdDev ┃ Run time ┃ Iters ┃
┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━┩
│ test_large_parse_yaml │ 168,216,041ns │        1.3% │    2.93s │    17 │
└───────────────────────┴───────────────┴─────────────┴──────────┴───────┘

Benchmark https://github.com/bdraco/pyyaml/blob/bench/tests_bench/benchmarks/test_simple_load.py (execute with pytest --codspeed tests_bench/benchmarks/test_simple_load.py)

Cython analysis via cythonize -X language_level=3 -a -i yaml/_yaml.pyx

Before
Screenshot 2025-02-21 at 12 07 34 PM

After
Screenshot 2025-02-21 at 12 07 56 PM

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