Faster string to integer conversion

Paul Eggert eggert@cs.ucla.edu
Sun Apr 10 19:54:00 GMT 2016


Thanks for thinking about this. Certainly strtol etc. could be sped up and the 
approach you mention might be a win; it's hard to say, given its setup overhead. 
In practice most integers are small, and you'd need to benchmark the approach on 
a set of integers that are of "typical" size. It may well be more work to come 
up with a convincing benchmark than to come up with the actual code.

If you're interested in strtol speedup ideas, how about this one? Jettison 
tables like __strtol_ul_max_tab and replace their uses with invocations of the 
INT_ADD_WRAPV macro defined by the following recently-proposed patch:

https://sourceware.org/ml/libc-alpha/2016-04/msg00174.html



More information about the Libc-alpha mailing list