itoa-benchmark icon indicating copy to clipboard operation
itoa-benchmark copied to clipboard

Another addition to your benchmark ?

Open rchateauneu opened this issue 7 years ago • 5 comments

Hello

Please have a look at the Sourceforge project: https://sourceforge.net/projects/itoa/files/itoa/ http://itoa.cvs.sourceforge.net/itoa/itoa/

It gives interesting performance compared to the existing benches.

On top of that:

  • It returns the address of the end of the string which is useful for concatenating strings.
  • It is entirely portable, no specific instructions.
  • It is written in C, not in C++.

Regards

Remi

rchateauneu avatar Nov 01 '16 22:11 rchateauneu

Would you like to make a pull request with the integration?

miloyip avatar Nov 02 '16 01:11 miloyip

Done. Tested on Windows with interesting results (No compilation warning). I plan an extra speedup by recoding a division by 10000.

rchateauneu avatar Nov 02 '16 22:11 rchateauneu

@rchateauneu: I had a look at your library and can't see any improvements over the top 5 from the following benchmark:

https://gist.github.com/anonymous/e78c3535e72d54208529


@miloyip what do you think? perhaps it's time for a more rigorous benchmark?

@WojciechMigda mind implementing Terje algorithm?

ArashPartow avatar Nov 21 '16 21:11 ArashPartow

@ArashPartow I've been thinking about it for a while already. As usual - depends how much spare time I'd have and not spend it on sth else.

WojciechMigda avatar Dec 06 '16 10:12 WojciechMigda

Here is what I have with Visual Studio 2013, Win32 model, Intel G3250, 3.2 GHz . These results made me think it was worth sharing them. I let you see if you have similar numbers on your own platform.

u32toa Benchmarking sequential amartin ... [ 4.375ns, 11.473ns] Benchmarking random amartin ... 17.274ns Benchmarking sequential branchlut ... [ 4.314ns, 9.917ns] Benchmarking random branchlut ... 15.338ns Benchmarking sequential count ... [ 7.335ns, 22.904ns] Benchmarking random count ... 22.612ns Benchmarking sequential countlut ... [ 6.338ns, 14.613ns] Benchmarking random countlut ... 18.415ns Benchmarking sequential lut ... [ 4.696ns, 17.984ns] Benchmarking random lut ... 20.655ns Benchmarking sequential mwilson ... [ 4.910ns, 25.967ns] Benchmarking random mwilson ... 22.860ns Benchmarking sequential naive ... [ 5.539ns, 28.818ns] Benchmarking random naive ... 24.812ns Benchmarking sequential null ... [ 1.876ns, 1.880ns] Benchmarking random null ... 1.883ns Benchmarking sequential rchateauneu ... [ 3.050ns, 9.272ns] Benchmarking random rchateauneu ... 15.346ns Benchmarking sequential sprintf ... [ 87.381ns, 241.731ns] Benchmarking random sprintf ... 178.573ns Benchmarking sequential sse2 ... [ 4.384ns, 9.956ns] Benchmarking random sse2 ... 15.056ns Benchmarking sequential unnamed ... [ 6.264ns, 38.479ns] Benchmarking random unnamed ... 31.084ns Benchmarking sequential vc ... [ 18.385ns, 122.915ns] Benchmarking random vc ... 81.557ns

i32toa Benchmarking sequential amartin ... [ 5.036ns, 12.108ns] Benchmarking random amartin ... 20.050ns Benchmarking sequential branchlut ... [ 6.068ns, 12.938ns] Benchmarking random branchlut ... 20.824ns Benchmarking sequential count ... [ 8.888ns, 25.646ns] Benchmarking random count ... 27.177ns Benchmarking sequential countlut ... [ 8.269ns, 17.656ns] Benchmarking random countlut ... 23.832ns Benchmarking sequential lut ... [ 6.472ns, 20.995ns] Benchmarking random lut ... 26.464ns Benchmarking sequential mwilson ... [ 6.572ns, 32.972ns] Benchmarking random mwilson ... 29.959ns Benchmarking sequential naive ... [ 7.412ns, 31.884ns] Benchmarking random naive ... 29.449ns Benchmarking sequential null ... [ 2.191ns, 2.245ns] Benchmarking random null ... 1.881ns Benchmarking sequential rchateauneu ... [ 4.253ns, 10.110ns] Benchmarking random rchateauneu ... 19.030ns Benchmarking sequential sprintf ... [ 93.343ns, 250.494ns] Benchmarking random sprintf ... 188.685ns Benchmarking sequential sse2 ... [ 6.152ns, 12.278ns] Benchmarking random sse2 ... 20.465ns Benchmarking sequential unnamed ... [ 7.361ns, 36.715ns] Benchmarking random unnamed ... 33.376ns Benchmarking sequential vc ... [ 10.838ns, 78.782ns] Benchmarking random vc ... 61.806ns

u64toa Benchmarking sequential amartin ... [ 6.511ns, 51.494ns] Benchmarking random amartin ... 36.430ns Benchmarking sequential branchlut ... [ 4.471ns, 72.518ns] Benchmarking random branchlut ... 41.576ns Benchmarking sequential count ... [ 14.003ns, 212.522ns] Benchmarking random count ... 127.754ns Benchmarking sequential countlut ... [ 6.921ns, 43.543ns] Benchmarking random countlut ... 37.954ns Benchmarking sequential lut ... [ 5.324ns, 112.703ns] Benchmarking random lut ... 82.316ns Benchmarking sequential mwilson ... [ 11.511ns, 235.804ns] Benchmarking random mwilson ... 129.917ns Benchmarking sequential naive ... [ 14.247ns, 226.666ns] Benchmarking random naive ... 153.110ns Benchmarking sequential null ... [ 1.876ns, 1.995ns] Benchmarking random null ... 1.887ns Benchmarking sequential rchateauneu ... [ 3.480ns, 45.509ns] Benchmarking random rchateauneu ... 36.627ns Benchmarking sequential sprintf ... [ 93.003ns, 426.311ns] Benchmarking random sprintf ... 272.926ns Benchmarking sequential sse2 ... [ 5.902ns, 62.643ns] Benchmarking random sse2 ... 44.699ns Benchmarking sequential unnamed ... [ 8.246ns, 500.183ns] Benchmarking random unnamed ... 181.895ns Benchmarking sequential vc ... [ 19.732ns, 250.154ns] Benchmarking random vc ... 145.472ns

i64toa Benchmarking sequential amartin ... [ 12.416ns, 60.513ns] Benchmarking random amartin ... 43.586ns Benchmarking sequential branchlut ... [ 11.572ns, 81.284ns] Benchmarking random branchlut ... 48.288ns Benchmarking sequential count ... [ 21.589ns, 212.487ns] Benchmarking random count ... 135.475ns Benchmarking sequential countlut ... [ 14.132ns, 51.186ns] Benchmarking random countlut ... 43.682ns Benchmarking sequential lut ... [ 12.614ns, 121.109ns] Benchmarking random lut ... 88.450ns Benchmarking sequential mwilson ... [ 20.007ns, 322.441ns] Benchmarking random mwilson ... 188.790ns Benchmarking sequential naive ... [ 20.537ns, 226.564ns] Benchmarking random naive ... 156.245ns Benchmarking sequential null ... [ 4.667ns, 5.263ns] Benchmarking random null ... 1.890ns Benchmarking sequential rchateauneu ... [ 10.414ns, 53.101ns] Benchmarking random rchateauneu ... 43.156ns Benchmarking sequential sprintf ... [ 103.065ns, 426.686ns] Benchmarking random sprintf ... 282.203ns Benchmarking sequential sse2 ... [ 12.643ns, 70.151ns] Benchmarking random sse2 ... 50.799ns Benchmarking sequential unnamed ... [ 12.534ns, 517.903ns] Benchmarking random unnamed ... 204.937ns Benchmarking sequential vc ... [ 25.277ns, 243.903ns] Benchmarking random vc ... 152.277ns

rchateauneu avatar Dec 06 '16 23:12 rchateauneu