13
0
livetrax/libs/pbd
Tim Mayberry 816f3bfb36 Use std::vector::reserve to improve performance of adding properties
The number of properties per node roughly corresponds to the number of members
of the class the node is representing and should be fairly low.

Use std::vector::reserve to prevent reallocation on insert for most node types,
there are exceptions like Region(~40 properties).

This seems worth it as part(maybe 1/10th of the total time) of saving a Session
is a combination of what occurs in "Create" and "Write" in this test.

Perf results before changes:

XMLTest::testPerfMediumXMLDocumentTiming
   Create : Count: 10 Min: 30610 Max: 42656 Total: 376672 Avg: 37667 (37 msecs)
   Write : Count: 10 Min: 42804 Max: 54277 Total: 460455 Avg: 46045 (46 msecs)
   Read : Count: 10 Min: 70364 Max: 85484 Total: 750909 Avg: 75090 (75 msecs)
XMLTest::testPerfLargeXMLDocumentTiming
   Create : Count: 10 Min: 164360 Max: 356995 Total: 3064482 Avg: 306448 (306 msecs)
   Write : Count: 10 Min: 308655 Max: 372953 Total: 3226707 Avg: 322670 (322 msecs)
   Read : Count: 10 Min: 517243 Max: 541839 Total: 5289950 Avg: 528995 (528 msecs)

Perf results after 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)
2016-10-10 08:45:34 +10:00
..
boost-debug globally remove all trailing whitespace from .cpp and .hpp files missed by previous commit 2015-10-04 15:11:15 -04:00
macosx copy all XCode project files from Tracks. 2015-06-29 14:18:10 -04:00
msvc Move 'round()' / 'trunc()' etc so that they won't conflict with any versions already available in MSVC 2016-08-19 14:11:01 +01:00
MSVCpbd Modify our MSVC project to use the newly introduced 'libarchive' library (libpbd) 2016-09-15 14:39:38 +01:00
pbd Remove PropertyMap from XMLNode class 2016-10-10 08:45:34 +10:00
test Add test of pbd/xml++.h API performance with three file sizes 2016-10-10 08:45:34 +10:00
base_ui.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
basename.cc globally remove all trailing whitespace from ardour code base. 2015-10-04 14:51:05 -04:00
boost_debug.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
cartesian.cc globally remove all trailing whitespace from ardour code base. 2015-10-04 14:51:05 -04:00
ChangeLog
cocoa_open_uri.mm Stop compiler warning about NSURL 2013-08-08 15:26:18 -04:00
command.cc globally remove all trailing whitespace from ardour code base. 2015-10-04 14:51:05 -04:00
configuration_variable.cc OMNIBUS COMMIT: prefer const XMLNode::property method (and provide a real one) 2016-05-04 23:09:45 -04:00
controllable.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
convert.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
COPYING
cpus.cc Enable build for FreeBSD (part 1/2) 2016-06-26 16:43:07 +02:00
crossthread.cc globally remove all trailing whitespace from ardour code base. 2015-10-04 14:51:05 -04:00
crossthread.posix.cc let GMainContext clean up after us. 2016-04-26 19:45:06 +02:00
crossthread.win.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
debug_rt_alloc.c Accommodate 'pthread-win32' and 'boost/regex' (for libpbd) 2013-07-17 08:06:26 +01:00
debug.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
demangle.cc Use PBD::demangle_symbol in PBD::demangled_name<T> to reduce code duplication 2015-12-01 14:22:38 +10:00
enums.cc fix simple but fatal mistake in defining PBD::Controllable::Flags enums. 2016-07-12 08:34:35 -04:00
enumwriter.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
epa.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
error.cc globally remove all trailing whitespace from ardour code base. 2015-10-04 14:51:05 -04:00
event_loop.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
ffs.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
file_archive.cc add API to create [tar.xz] archives 2016-09-19 11:33:07 +02:00
file_utils.cc Move PBD::canonical_path to pbd/file_utils.h/cc and reimplement for Windows 2016-09-19 14:47:52 +10:00
fpu.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
gettext.h
id.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
libpbd.pc.in
libpbd.spec.in
locale_guard.cc add exception handling in LocaleGuard, to try to cover more OS X wierd/corner cases 2016-07-18 10:56:43 -04:00
localtime_r.cc mingw build fixes (tested with i686-w64-mingw32 on linux-x86_64) 2014-03-04 15:25:58 +01:00
malign.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
md5.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
mountpoint.cc NetBSD uses statvfs for the functionality of statfs on Linux 2016-10-04 22:18:23 +02:00
openuri.cc now with return value 2016-02-17 17:03:14 +01:00
pathexpand.cc Move PBD::canonical_path to pbd/file_utils.h/cc and reimplement for Windows 2016-09-19 14:47:52 +10:00
pbd.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
pool.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
property_list.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
pthread_utils.cc the endless quest to plug memory leaks -- episode 378 2016-07-25 17:16:32 +02:00
reallocpool.cc tweak realloc-pool realloc behavior. 2016-07-19 15:05:16 +02:00
receiver.cc change PBD::Transmitter code to use PBD::Signal<> not sigc::signal<>, since the latter is not thread safe 2016-08-14 08:33:23 -04:00
resource.cc Remaining changes needed for building libpdb on Windows (except for adding the extra JE source modules) 2013-07-17 08:08:46 +01:00
run-tests.sh Remove references in pbd test script to libs no longer in source tree 2014-12-03 17:31:04 +07:00
search_path.cc Add PBD::Searchpath::contains method to check if a Searchpath contains a path 2015-10-22 11:51:03 -04:00
semutils.cc rename ProcessSemaphore to Semaphore (libs) 2015-12-02 20:18:48 +01:00
shortpath.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
signals.cc globally remove all trailing whitespace from ardour code base. 2015-10-04 14:51:05 -04:00
stacktrace.cc Move PBD symbol demangle functions into pbd/demangle.h/cc 2015-12-01 14:22:38 +10:00
stateful_diff_command.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
stateful.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
strreplace.cc globally remove all trailing whitespace from ardour code base. 2015-10-04 14:51:05 -04:00
strsplit.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
system_exec.cc and another typo in d442190b 2016-02-14 00:10:41 +01:00
textreceiver.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
timer.cc add API to suspend timers signal emission. 2015-10-30 15:55:26 +01:00
timing.cc Change position of average in PBD::timing_summary and add msecs 2016-10-10 08:45:34 +10:00
tlsf.cc add missing header include 2016-07-19 20:33:36 +02:00
transmitter.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
undo.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
uuid.cc use boost::uuids method to get a string from a boost UUID 2014-02-17 15:29:18 -05:00
whitespace.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
windows_mmcss.cc Move Windows MMCSS related utility functions into libpbd 2015-09-16 11:22:16 +10:00
windows_special_dirs.cc NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
windows_timer_utils.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
wscript NetBSD ships with backtrace(3) in libexecinfo 2016-10-04 22:18:52 +02:00
xml++.cc Use std::vector::reserve to improve performance of adding properties 2016-10-10 08:45:34 +10:00