author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 25 May 2009 22:23:06 +0000 (22:23 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Mon, 25 May 2009 22:23:06 +0000 (22:23 +0000) | ||
commit | b7925487290680d9428c1727f8e72c0ef27176da | |
tree | af390dc87a8be6d7059b7a95b573c9d687eaa37f | tree | snapshot |
parent | 5a2b1098791c3eb4a15a11d6b04bab88d46adbc9 | commit | diff |
While restoring, rrd_restore uses between 30 and 40 times as much memory as
the size of the rrd file to be restored. This is due to the use of libxml2
for parsing the the whole file prior to turning it into rrd structs.
This patch switches rrd_restore to using the xmlTextReader interface for
incremental consumtion of xml files. This reduces the memory requirements to
about twice the size of the rrd file which should be quite manageable for
most cases.
The parsing is about 25% less efficient than with the original libxml2
version of rrd_restore. This could be in part due to the more liberal use of
malloced memory. Optimizing this is for another day though.
--tobi
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1811 a5681a0c-68f1-0310-ab6d-d61299d08faa
the size of the rrd file to be restored. This is due to the use of libxml2
for parsing the the whole file prior to turning it into rrd structs.
This patch switches rrd_restore to using the xmlTextReader interface for
incremental consumtion of xml files. This reduces the memory requirements to
about twice the size of the rrd file which should be quite manageable for
most cases.
The parsing is about 25% less efficient than with the original libxml2
version of rrd_restore. This could be in part due to the more liberal use of
malloced memory. Optimizing this is for another day though.
--tobi
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1811 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_restore.c | diff | blob | history |