[KimDaBa] Profiling Kimdaba startup

David Fraser davidf at sjsoft.com
Wed Jan 5 07:58:04 CET 2005


Jody Harris wrote:

> A humble thought on making start time shorter:
>
> One way to compress the load time would be to compress the xml file. 
> Because of XML's inherent "spaciness," there is some (large) 
> percentage of the file that is read from disk, then "tossed" (white 
> spaces, tags, etc) as data is put into an in-memory data structure.
>
> Since much of this information is highly redundant, you should be able 
> to gain a high amount of compression on the data even at the default 
> (6?) compression level.  Time save reading the data should more than 
> offset time decompressing the data.
>
> Some tests:
>
> My original file: 5743 images, 3.2MB
>
> Copy index.xml from A to B:
> bigpig@~ $ time cp photo/index.xml tmp
>
> real    0m0.194s
> user    0m0.001s
> sys     0m0.028s
>
> Compression step with gzip, default settings:
> bigpig@~ $ time gzip tmp/index.xml
>
> real    0m0.107s
> user    0m0.092s
> sys     0m0.006s
>
>
> Resulting compressed file: 209KB (!)
>
> Make a copy of the compressed file with gzip:
> bigpig@~ $ time cp tmp/index.xml.gz tmp/index.xml.gz.2
>
> real    0m0.006s
> user    0m0.002s
> sys     0m0.003s
>
> Unzip the compressed file:
> bigpig@~ $ time gzip -d tmp/index.xml.gz
>
> real    0m0.034s
> user    0m0.020s
> sys     0m0.010s
>
>
> Granted those are "one-time tests."  to get a good benchmark, you'd 
> need to run each step enough times to get a system average, but if 
> these numbers are even close, we're looking at 0.040s (real) vs 0.194s 
> (real), a savings of ~79%.
>
> Jesper?  What do you think?  Robert?  Michael?  Others?
>
> jody

Hi Jody

Most of the time isn't reading the file from disk etc but parsing the xml...

David

PS I think you forgot to cc the list.



More information about the KimDaBa mailing list