Optimizing stuff again
There was still room for improvement :-)
_() for translation is slow
%f is slow
localtime() is slow – but there I didn’t find any workaround
thousands of fread()/fwrite() is slow, mmap is faster.
There was still room for improvement :-)
_() for translation is slow
%f is slow
localtime() is slow – but there I didn’t find any workaround
thousands of fread()/fwrite() is slow, mmap is faster.
August 25th, 2006 at 20:19
Youpi ^_^
(even if I don’t understand what you say :-p %f is slow ?? )
August 25th, 2006 at 20:37
Yes – sprintf(“%.2f”, size), for example, used for filling the Size column, is really slow. “%.2f” is a format modifier meaning “float number with two digits after the comma”.
It’s faster to use sprintf(“%d.%d”, a, b) and use a simple integer division to get the part before the comma, then a multiplication of the remainer by the rest, then a re-division to keep one number after the comma. – Faster enough to warrant the hassle !
August 30th, 2006 at 17:40
Il fallait y penser ! Bravo.