Skip to content

Unquoting improvements #1529

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Vizonex
Copy link

@Vizonex Vizonex commented Jun 10, 2025

What do these changes do?

How do I keep finding things to optimize??? I got rid of the list in the unquoter and I replaced it with a custom unicode writer I wrote. I'm gonna allow anybody to use it as they wish since it's got a feature where it's able to dynamically handle unicode characters but now we can get rid of needing to join a bunch of python objects all at one time.

Are there changes in behavior for the user?

There's a new technique in the Unquoter that allocates the same amount of memory as the string it's taking in to be examined and decoded. This should be an optimization and not a performance bottleneck now.

Related issue number

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

Vizonex and others added 5 commits June 10, 2025 13:44
I made this thing after finding out how restrictive CPython's String API Was and knew that using and joining a list would be too heap expensive Not to mention reference counting. I'll be testing this in a bit to ensure it works.
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Jun 10, 2025
Copy link

codspeed-hq bot commented Jun 10, 2025

CodSpeed Performance Report

Merging #1529 will degrade performances by 72.21%

Comparing Vizonex:Unquoting-Improvements (3e4fdbe) with master (3871d2c)

Summary

❌ 7 regressions
✅ 94 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_unquoter_long_ascii 12.3 ms 44.3 ms -72.21%
test_unquoter_long_pct 15.4 ms 45.6 ms -66.17%
test_unquoter_short 227.3 µs 501.6 µs -54.68%
test_parse_query_uncached[long] 23.6 ms 39.6 ms -40.43%
test_parse_query_uncached[short] 1.9 ms 3.1 ms -36.8%
test_path_safe_uncached 287.7 µs 445.2 µs -35.37%
test_update_query_string 662 µs 720.2 µs -8.09%

@Vizonex
Copy link
Author

Vizonex commented Jun 10, 2025

how is that a regression do I stand corrected?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant