4 ms·
You mean like this, from the article? > Given that this is an Apple operating system, we might know it has a snprintf_l function which takes an explicit locale
by markdog12 5y ago
You mean like this, from the article?
> Given that this is an Apple operating system, we might know it has a snprintf_l function which takes an explicit locale, and hope that this would make it scale. Just pass NULL which means “use C locale”:
And then the chart and discussion following it?
- addaon 5y agoRight. My point is that the change from sprintf() to sprintf(..., NULL, ...) is a semantic-modifying change. For the purpose of understanding what's going on, that's fine. For the purpose of optimizing software, that's scary. And even scarier is that it seems somewhat more likely that the version under test is more correct than the version as shipped.
- markdog12 5y ago> Technically, there are no bugs anywhere above - all the functions work correctly They were all correct. But yeah, scary how primitives can result in such poor performance. FWIW, they ended up using {fmt}: https://developer.blender.org/D13998 https://developer.blender.org/D13998
- rocqua 5y agoThat concerns the printf implementations. The point parent poster os making, is that previously, unless set_locale was being called by blender, the resulting export of a blender object was locale dependent. The change from sprintf(..) to sprintf(..., NULL), would then actually change the behavior (not just performance) of the program.