Remove normalization of property names from libpbd xml code
authorTim Mayberry <mojofunk@gmail.com>
Fri, 23 Sep 2016 13:05:44 +0000 (23:05 +1000)
committerTim Mayberry <mojofunk@gmail.com>
Thu, 25 May 2017 22:48:04 +0000 (08:48 +1000)
It may have been OK to add this code temporarily at this low level, but as it
was introduced in 2008, this change is made with the assumption that any
Sessions that were affected have been re-saved since then with corrected
property names and that "normalization" is no longer necessary.

Timing results before changes:

XMLTest::testPerfMediumXMLDocumentTiming
   Create : Count: 10 Min: 30375 Max: 48253 Total: 431727 Avg: 43172 (43 msecs)
   Write : Count: 10 Min: 42553 Max: 49163 Total: 453353 Avg: 45335 (45 msecs)
   Read : Count: 10 Min: 70307 Max: 75987 Total: 734923 Avg: 73492 (73 msecs)
XMLTest::testPerfLargeXMLDocumentTiming
   Create : Count: 10 Min: 154486 Max: 307856 Total: 2678989 Avg: 267898 (267 msecs)
   Write : Count: 10 Min: 304273 Max: 343274 Total: 3169158 Avg: 316915 (316 msecs)
   Read : Count: 10 Min: 496920 Max: 541394 Total: 5260410 Avg: 526041 (526 msecs)

Timing results after changes:

XMLTest::testPerfMediumXMLDocumentTiming
   Create : Count: 10 Min: 21437 Max: 39749 Total: 348622 Avg: 34862 (34 msecs)
   Write : Count: 10 Min: 42320 Max: 49989 Total: 446135 Avg: 44613 (44 msecs)
   Read : Count: 10 Min: 63252 Max: 68389 Total: 660841 Avg: 66084 (66 msecs)
XMLTest::testPerfLargeXMLDocumentTiming
   Create : Count: 10 Min: 113458 Max: 263225 Total: 2215595 Avg: 221559 (221 msecs)
   Write : Count: 10 Min: 305439 Max: 339986 Total: 3150697 Avg: 315069 (315 msecs)
   Read : Count: 10 Min: 447560 Max: 488121 Total: 4698903 Avg: 469890 (469 msecs)

libs/pbd/xml++.cc

index 5b2ed2b1906e9fd803db546b4f039ee5f7b6513b..c46c5638b87257bc1b6838bdcbdeb197ffe90eca 100644 (file)
@@ -662,12 +662,6 @@ XMLProperty::XMLProperty(const string& n, const string& v)
        : _name(n)
        , _value(v)
 {
-       // Normalize property name (replace '_' with '-' as old session are inconsistent)
-       for (size_t i = 0; i < _name.length(); ++i) {
-               if (_name[i] == '_') {
-                       _name[i] = '-';
-               }
-       }
 }
 
 XMLProperty::~XMLProperty()