Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Faster utf7 encode #373
~40% faster for input with a mix of unicode and ascii chars. The improvement is more significant for pure ascii chars.
This is achieved by removing the .encode() in the most common path (ascii char) and comparing ordinal values instead of unicode objects.
Actually we can get 10% more by eliminating dot notation, 10-20% more by inlining
Forgot to attach the benchmark script and results: