1 apr 2015 kl. 05.35 skrev Dongsheng Song <dongsheng.s...@gmail.com>:

> In my testing, getenv() is very fast.
> 
> *) unset PRINTF_EXPONENT_DIGITS
> 
> preheat 10000 times, then perform 1000000 times (use 4.67777 seconds)
> getenv cost: 4.67777 us
> 
> *) set PRINTF_EXPONENT_DIGITS=3
> preheat 10000 times, then perform 1000000 times (use 3.41991 seconds)
> getenv: 3.41991 us

4 µs is a lot on a modern CPU, and an unacceptable overhead for a basic library 
function such as sprintf.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to