Re: [xml] Useless function calls in xmlSetProp()?
- From: "Aron Stansvik" <elvstone gmail com>
- To: xml gnome org
- Subject: Re: [xml] Useless function calls in xmlSetProp()?
- Date: Fri, 22 Feb 2008 11:58:27 +0100
2008/2/22, Julien Charbon <jch 4js com>:
Daniel Veillard wrote:
> On Fri, Feb 08, 2008 at 05:17:31PM +0100, Julien Charbon wrote:
Seems fine and clear. Attached to this email the "final" patch
>> against current trunk.
>
> okidoc, rereviewed it, it looks fine, applied, tested still fine, so I
> commited it, thanks a lot !
Thanks to you, for reviewing and applying patch.
> In completely unscientific testings, runtest number of allocs are reduced
> from 3,058,476 to 3,053,663 which is around 0.15% , it really depends on
> the kind of documents used and what processing.
Right. I made a tiny prog [again], that show time made by a call to
xmlSetProp() with an attribute value that double in size every iteration:
- With old xmlSetProp():
$ ./test-setprop-big
Size: 8 Time: 000:000014397
Size: 16 Time: 000:000003429
Size: 32 Time: 000:000003164
Size: 64 Time: 000:000004435
Size: 128 Time: 000:000033918
Size: 256 Time: 000:000017600
Size: 512 Time: 000:000042089
Size: 1024 Time: 000:000120426
Size: 2048 Time: 000:000400574
Size: 4096 Time: 000:001471683
Size: 8192 Time: 000:005275916
Size: 16384 Time: 000:020225833
Size: 32768 Time: 000:078549300
Size: 65536 Time: 000:304803839
Size: 131072 Time: 001:240064893
Size: 262144 Time: 004:963828528
Size: 524288 Time: 019:846718130
Size: 1048576 Time: 078:606054215
- With "new" [now current] xmlSetProp():
$ ./test-setprop-big
Size: 8 Time: 000:000004981
Size: 16 Time: 000:000001847
Size: 32 Time: 000:000000906
Size: 64 Time: 000:000000926
Size: 128 Time: 000:000001011
Size: 256 Time: 000:000001327
Size: 512 Time: 000:000001842
Size: 1024 Time: 000:000002458
Size: 2048 Time: 000:000004280
Size: 4096 Time: 000:000007559
Size: 8192 Time: 000:000022546
Size: 16384 Time: 000:000028533
Size: 32768 Time: 000:000054189
Size: 65536 Time: 000:000107761
Size: 131072 Time: 000:000218971
Size: 262144 Time: 000:000584088
Size: 524288 Time: 000:001057238
Size: 1048576 Time: 000:002148980
[Yes, attributes with value size of 1 MB are unrealistic, it is just
to show how xmlSetProp() scaled before setprop.patch]
Though the d attribute in SVG's path element can get quite big with
complex paths, but yes finding 1 MB attributes in the wild is probably
unlikely :)
Aron
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]