[opendemo-devel] ODcut much faster: odfile_parser.pm
Status: Beta
Brought to you by:
girlich
From: Dr. U. G. <Uwe...@ph...> - 2004-02-23 09:46:40
|
Hello! The new implementation of the odfile interface is based on XML::Parser, which is a small layer around Expat. The old one was based on XML::DOM, which also uses XML::Parser for XML parsing but has an object interface written totally in Perl. A short performance test on a 800MHz Duron: echo q | time ./odcut.pl ../../test/profile/odprofile.odq3a -f dom 40.81user 3.18system 0:49.62elapsed 88%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (492major+32016minor)pagefaults 0swaps echo q | time ./odcut.pl ../../test/profile/odprofile.odq3a -f parser 8.72user 0.65system 0:10.02elapsed 93%CPU (0avgtext+0avgdata 0maxresident)k 0inputs+0outputs (489major+12125minor)pagefaults 0swaps Thus reading in a 3115634 bytes XML file goes from 40.81 seconds down to mere 8.72 seconds, which results in a speedup factor of 4.68. Then I checked the more important frame output time: ./odcut.pl ../../test/profile/odprofile.odq3a -f dom -l 10 b r 0 1 i 1 show in the logging, that the avagage wait time is -0.12 seconds (the system is too slow to print even frame 1 in time). The calculation time was 0.050 - ( -0.12) = 0.170 On the other hand ./odcut.pl ../../test/profile/odprofile.odq3a -f parser -l 10 b r 0 1 i 1 show in the logging, that the avagage wait time is 0.025 seconds. The calculation time was 0.050 - 0.025 = 0.025 seconds, which results in a speedup factor of 6.8. As much as I'm happy about this, it is not enough. Frame 0 is a more complete frame and it takes 0.050 - (-0.14) = 0.19 seconds even with -f parser (-f dom was totally inacceptable with a calc time of over a whole second). When I shall implement on-the-fly delta-compression, there is much more to do that the calculation of frame 0. I'll repeat these tests later today at home on a fater system but it seems to become clear: I have to go back to plain C for this. Bye, Uwe |