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
macosx
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
boost_debug.cc
cartesian.cc
ChangeLog
cocoa_open_uri.mm
command.cc
configuration_variable.cc
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
crossthread.posix.cc
crossthread.win.cc
debug_rt_alloc.c
debug.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
demangle.cc
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
error.cc
event_loop.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
ffs.cc
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
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
malign.cc enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
md5.cc
mountpoint.cc NetBSD uses statvfs for the functionality of statfs on Linux 2016-10-04 22:18:23 +02:00
openuri.cc
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
property_list.cc
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
run-tests.sh
search_path.cc
semutils.cc
shortpath.cc
signals.cc
stacktrace.cc
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
strsplit.cc
system_exec.cc
textreceiver.cc
timer.cc
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
undo.cc
uuid.cc
whitespace.cc
windows_mmcss.cc
windows_special_dirs.cc
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