[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Ledger::write() -- adding DOCTYPE support to xmlwrapp?
From: |
Greg Chicares |
Subject: |
Re: [lmi] Ledger::write() -- adding DOCTYPE support to xmlwrapp? |
Date: |
Sat, 13 Dec 2008 16:54:47 +0000 |
User-agent: |
Thunderbird 2.0.0.18 (Windows/20081105) |
On 2008-12-13 15:36Z, Vaclav Slavik wrote:
>
> On Fri, 2008-12-12 at 02:55 +0000, Greg Chicares wrote:
>
>> The only thing I know for sure is
>> that I measured a 25% performance penalty as noted in that comment.
>
> Do you remember how to run this particular test?
Yes, I think so. Run the 'input' unit test (with lmi's makefiles:
make unit_tests unit_test_targets=input_test.exe
or the autotools equivalent) before and after applying this
one-character patch:
Index: input_xml_io.cpp
===================================================================
RCS file: /sources/lmi/lmi/input_xml_io.cpp,v
retrieving revision 1.10
diff -U 3 -r1.10 input_xml_io.cpp
--- input_xml_io.cpp 17 Oct 2008 22:55:34 -0000 1.10
+++ input_xml_io.cpp 13 Dec 2008 16:42:50 -0000
@@ -135,7 +135,7 @@
// twenty-five percent slower. What would be really desirable is an
// (efficient) element-iterator class.
//
-#if 0
+#if 1
xml_lmi::ElementContainer const elements(xml_lmi::child_elements(x));
typedef xml_lmi::ElementContainer::const_iterator eci;
for(eci i = elements.begin(); i != elements.end(); ++i)
Here are my results (I discarded the first iteration each way,
in order to stabilize the timings):
before:
Overhead: 3.131e-005 s = 31307 ns, mean of 320 iterations
Vector : 2.280e-003 s = 2279796 ns, mean of 100 iterations
Read : 8.161e-003 s = 8160669 ns, mean of 100 iterations
Write : 2.923e-003 s = 2923109 ns, mean of 100 iterations
'cns' io: 5.782e-002 s = 57818859 ns, mean of 18 iterations
'ill' io: 1.504e-002 s = 15037891 ns, mean of 67 iterations
after:
Overhead: 3.215e-005 s = 32152 ns, mean of 312 iterations
Vector : 2.232e-003 s = 2232184 ns, mean of 100 iterations
Read : 1.020e-002 s = 10199924 ns, mean of 99 iterations
Write : 2.869e-003 s = 2869494 ns, mean of 100 iterations
'cns' io: 6.154e-002 s = 61541580 ns, mean of 17 iterations
'ill' io: 1.738e-002 s = 17377635 ns, mean of 58 iterations
ratio, after/before:
Overhead: 103%
Vector : 98%
Read : 125% <-- There's the 25% difference.
Write : 98%
'cns' io: 106%
'ill' io: 116%