skip2 / go-qrcode

:sparkles: QR Code encoder (Go)
http://go-qrcode.appspot.com
MIT License
2.64k stars 338 forks source link

Occasional byte encoding efficiency over mixed encoding #33

Closed vsenko closed 4 years ago

vsenko commented 4 years ago

Sometimes mixed encoding is less efficient than encoding everything as a single byte segment due to additional segments headers.

This pull request adds a switch to a single byte encoded segment in cases where it is suitable. Tests are adjusted as long as they contained samples that are smaller when encoded as single segments.

vsenko commented 4 years ago

@skip2, is there anything I can do to facilitate the merge?

skip2 commented 4 years ago

Hi vsenko, I've been running this optimisation in production for a week, and it works great. Thanks very much for the tests, I tried them on the previous version to check the improvement was happening.

thanks very much. skip2

vsenko commented 4 years ago

I'm glad to be helpful.

Thank you too!