memononen / fontstash

Light-weight online font texture atlas builder
zlib License
688 stars 88 forks source link

every so slightly faster implementation of utf8 decode #5

Closed aktau closed 11 years ago

aktau commented 11 years ago

On the bottom of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/, there's an alternative implementation with a pre-multiplied table, which saves a bit shift. So basically an instruction less in the icache and some bytes less in the data cache. I microbenchmarked it, and it was 10% faster in a tight loop.

Since it's copy and paste work, I think it might be a good idea to use it.

memononen commented 11 years ago

Closing as your later PR fixed this issue.