d2 file input performance

Christian Köstlin christian.koestlin at gmail.com
Wed Aug 31 22:12:06 PDT 2011


Update:

I added performance tests for ldc and gdc with the same programs.
The results are interesting (please see the github page for the details).

regards

christian

On 8/26/11 19:43 , Christian Köstlin wrote:
> Hi guys,
>
>
> i started the thread:
> http://stackoverflow.com/questions/7202710/fastest-way-of-reading-bytes-in-d2
> on stackoverflow, because i ran into kind of a problem.
>
> i wanted to read data from a file (or even better from a stream, but
> lets stay with file), byte-by-byte. the whole thing was part of my
> protobuf implementation for d2, and there you have to look at each byte
> to read out the varints. i was very proud of my implementation until i
> benchmarked it first against java (ok ... i was a little slower than
> java) and then against c++ (ok ... this was a complete different game).
>
> after some optimizing i got better, but was still way slower than c++.
> so i started some small microbenchmarks regarding fileio:
> https://github.com/gizmomogwai/performance in c++, java and d2.
>
> could you help me improve on the d2 performance? i am sure, that i am
> missing something fundamental, because i thing it should be at least
> possible be equal or better than java.
>
> thanks in advance
>
> christian



More information about the Digitalmars-d-learn mailing list