Our grisu2 implementation of to_chars is adapted from JSON for Modern C++. We have no reason to think that it is fastest or best optimized. It is likely that we should replace it with a more recent algorithm. However, there might be some optimization opportunities to the existing implementation such as...
- line 810 : branching could be avoided
- line 122 : a fast clz function might be better
credit : @agavrel