Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Performance of %Ld formats #6577
Original bug ID: 6577
My intuition was that with the new compile-time based implementation of format strings the following two lines would run at approximately the same speed:
However, some micro-benchmark indicates that the first one is about 33% slower than the second one. Same kind of observation for %ld, but not for %d.
This is not a big deal, but maybe some simple shortcuts for common boxed integer format specifiers could bring some non-negligible speedup.
I assume the performance hit comes from CamlinternalFormat.format_of_aconv. I'd try to specialize it to the three use cases (l, L, n) and always returns string literals, as format_of_iconv.