How would I optimize this parser?

bearophile bearophileHUGS at lycos.com
Sun Oct 31 19:02:10 PDT 2010


bearophile:
> Now the total running time is about 0.3 seconds instead of 1.1 seconds.

The program allocates 169_000 TextNode  and 245_001 TagNode. Just allocating two dynamic arrays of them, even with disabled GC, takes about 0.16 seconds of the about 0.30 of running time.

The children arrays inside TagNode receive a total of 414_000 appends, they cause reallocations.

I'll try to study the code some more.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list