mini benchmark vtim formatting

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Oct 7 05:19:26 UTC 2018


--------
In message <853f9d84-9737-8a0c-e718-e73031302bbe at schokola.de>, Nils Goroll writ
es:

>* when representing time as a double, formatting a timestamp is now much more
>  expensive (7x - 20x) than retrieving the time

So the interesting question for me now, is if we can shave if we
stick with double and simply by tweaking the formatting.

Something like:

	printf("%ju.%06ju",
		(uint64_t)floor(foo),
		(uint64_t)floor((foo*1e6)) % 1000000UL);

(Obviously to be hidden with PF-like macro)

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the varnish-dev mailing list