http://d.puremagic.com/issues/show_bug.cgi?id=1923





------- Comment #6 from llu...@gmail.com  2009-03-29 10:15 -------
But for some reason D2 (druntime) timings are still huge.

Here is a test, dmd es 1.041 with the patch attached here, dmd2 is 2.026.

$ cat split.d
// Written by bearophile <bearophileh...@lycos.com>
// Fount at
http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=67673
// Sightly modified by Leandro Lucarella <llu...@gmail.com>
// (removed timings)

import std.file, std.string;
import std.stdio: writefln;
static import std.c.time;

void main() {
        auto txt = cast(string) read("split.txt");
        auto words = txt.split();
}

$ dmd -release -O -inline -ofsplit1 split.d 
$ dmd2 -release -O -inline -ofsplit2 split.d 
$ ls -lh split.txt 
-rw-r--r-- 1 luca luca 15M mar 28 17:01 split.txt
$ time ./split1

real    0m0.751s
user    0m0.443s
sys     0m0.128s
$ time ./split2

real    0m25.293s
user    0m20.517s
sys     0m0.233s

(timings for D1 without the patch are about the same as D2)


-- 

Reply via email to