Top 5

Benji Smith dlanguage at benjismith.net
Sat Oct 11 13:21:05 PDT 2008


Sergey Gromov wrote:
> Here's everything.  Sorry for a long post!  :D

Sweet. Thanks!

Here are my most recent timings:

StringTest.exe
----------------------------------------
   time to load file: 0.016087 seconds
   iterated through 5582655 characters, and found 1293934 spaces in 
0.068550 seconds
   String.indexOf(): found 43889 instances of 'the' in 0.022940 seconds
   replaced 43889 instances of 'the' with 'XXXX' in 0.182749 seconds
   split text into 1293935 words in 8.372263 seconds
   concatenated 1293935 words (with 5582656 chars) in 3.933354 seconds
   overall test duration: 12.597674 seconds

StringTest2.exe
----------------------------------------
   time to load file: 0.037179 seconds
   iterated through 5582655 characters, and found 1293934 spaces in 
0.129138 seconds
   String.indexOf(): found 43889 instances of 'the' in 0.023242 seconds
   replaced 43889 instances of 'the' with 'XXXX' in 0.178492 seconds
   split text into 1293935 words in 0.165258 seconds
   concatenated 1293935 words (with 5582656 chars) in 0.183627 seconds
   overall test duration: 0.718944 seconds


StringTest.java
----------------------------------------
   time to load file: 0.154415715 seconds
   iterated through 5582655 characters, and found 1293934 spaces in 
0.037969071 seconds
   String.indexOf(): found 43889 instances of 'the' in 0.04771919 seconds
   replaced 43889 instances of 'the' with 'XXXX' in 0.363044465 seconds
   split text into 1293935 words in 1.008946389 seconds
   concatenated 1293935 words (with 5582656 chars) in 0.28996758 seconds
   overall test duration: 1.916152193 seconds

Nice work Sergey and Andrei!

Do you think the Appender functionality should be in a template, or 
should it be built into the array implementation?

I still think the string *design* sucks though :)

--benji



More information about the Digitalmars-d mailing list