New UTF-8 stride function

Vladimir Panteleev vladimir at thecybershadow.net
Sun May 26 14:13:28 PDT 2013


On Sunday, 26 May 2013 at 20:49:36 UTC, Dmitry Olshansky wrote:
> It's the kind of thing that is tremendously hard to measure 
> accurately since it depends on the workload, architecture and 
> the time spent is very small. So don't take it by word I'm 
> almost certain that something is amiss (compiler switches and 
> whatnot).

For such cases, I found Agner's benchmarking utilities to be very 
useful. They print exact CPU statistics, such as numbers of 
micro-ops, cache misses, mispredicted branches, etc. I've used 
them very successfully when tuning my appender implementation.

To use them with D, I modified his C++ program to load a DLL and 
call a function, taking the DLL and function names from the 
command line.

Original program:
http://www.agner.org/optimize/testp.zip

My patch (to load a DLL):
http://dump.thecybershadow.net/5f55e8be5f8cd38ad60f218957ef24bb/PMCTestB.diff

Usage example (sort of):
https://github.com/CyberShadow/DAppenderResearch/blob/master/go-dll.bat

Hope this helps :)


More information about the Digitalmars-d mailing list