vectordotdev / vrl

Vector Remap Language
Mozilla Public License 2.0
136 stars 68 forks source link

enhancement(punycode): improve performance for already coded cases #1104

Closed esensar closed 2 weeks ago

esensar commented 3 weeks ago

This adds additional benchmarks for encode_punycode and decode_punycode, which demonstrate lower performance of these functions when validate flag is set to false. That is because without validation, a quick manual encoding / decoding is done, but it does not check beforehand if it is required at all.

This adds these checks for both encoding and decoding (and does so in case of decoding even when validate flag is true), which shows a big speedup in the benchmark for validate: false and a minor speedup for decoding with validate: true.