Slow GC?
bearophile
bearophileHUGS at lycos.com
Fri Mar 14 06:00:48 PDT 2008
Vladimir Panteleev:
You are very fast :-)
>Splitting a huge block of text by whitespace will cause an array that's comparable to the size of the original text (a slice is 8 bytes, so if words are 6-7 characters long by average, the size would be the same).<
Note that in practical situations I don't use a split() on such big chunk of text. In such situation I use xsplit(), the lazy version (that you can find in my d libs. That I hope to see added both to the Python and D string methods/string library) that is "hugely" faster in such situation :-)
>Phobos patch: http://d.puremagic.com/issues/show_bug.cgi?id=1923<
I'd like to try that code; can I do it?
>Improvement is also almost tenfold :)<
Sorry for the potentially stupid question: is this an improvement in the text splitting time, in the final garbage collection time when the program is finished, or is it just a blind sum of both?
General note: I think more people have to compare the speed of programs written in other languages (like Python, Java, OCaML, Clean, C with GCC, Perl, etc) to the same programs written in D, because this (often?) shows spots where D may need some improvements. I know D is a language in development still, so too much early optimization may be bad, but I think a bit of care in that regard may help anyway.
Bye and thank you,
bearophile
More information about the Digitalmars-d
mailing list