From a8773900a8268917e3949dbe750df9df688a557c Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 17 Jun 2012 21:20:51 +0000 Subject: Profile of duplicating lots of regions. git-svn-id: svn://localhost/ardour2/branches/3.0@12750 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/test/profiling/lots_of_regions.cc | 47 ++++++ .../test/profiling/sessions/1region/1region.ardour | 181 +++++++++++++++++++++ .../profiling/sessions/1region/1region.ardour.bak | 148 +++++++++++++++++ .../profiling/sessions/1region/1region.history | 38 +++++ .../profiling/sessions/1region/1region.history.bak | 2 + .../test/profiling/sessions/1region/instant.xml | 13 ++ 6 files changed, 429 insertions(+) create mode 100644 libs/ardour/test/profiling/lots_of_regions.cc create mode 100644 libs/ardour/test/profiling/sessions/1region/1region.ardour create mode 100644 libs/ardour/test/profiling/sessions/1region/1region.ardour.bak create mode 100644 libs/ardour/test/profiling/sessions/1region/1region.history create mode 100644 libs/ardour/test/profiling/sessions/1region/1region.history.bak create mode 100644 libs/ardour/test/profiling/sessions/1region/instant.xml (limited to 'libs/ardour/test/profiling') diff --git a/libs/ardour/test/profiling/lots_of_regions.cc b/libs/ardour/test/profiling/lots_of_regions.cc new file mode 100644 index 0000000000..51166265bf --- /dev/null +++ b/libs/ardour/test/profiling/lots_of_regions.cc @@ -0,0 +1,47 @@ +#include "test_util.h" +#include "ardour/ardour.h" +#include "ardour/midi_track.h" +#include "ardour/midi_region.h" +#include "ardour/session.h" +#include "ardour/playlist.h" +#include "pbd/stateful_diff_command.h" + +using namespace std; +using namespace ARDOUR; +using namespace PBD; + +int +main (int argc, char* argv[]) +{ + ARDOUR::init (false, true); + Session* session = load_session ("../libs/ardour/test/profiling/sessions/1region", "1region.ardour"); + + /* Find the track */ + boost::shared_ptr track = boost::dynamic_pointer_cast (session->get_routes()->back()); + assert (track); + + /* And the playlist */ + boost::shared_ptr playlist = track->playlist (); + assert (playlist); + + /* And the region */ + boost::shared_ptr region = boost::dynamic_pointer_cast (playlist->region_list().rlist().front()); + assert (region); + + /* Duplicate it a lot */ + session->begin_reversible_command ("foo"); + playlist->clear_changes (); + playlist->duplicate (region, region->last_frame(), 1000); + session->add_command (new StatefulDiffCommand (playlist)); + session->commit_reversible_command (); + + /* Undo that */ + session->undo (1); + + /* And do it again */ + session->begin_reversible_command ("foo"); + playlist->clear_changes (); + playlist->duplicate (region, region->last_frame(), 1000); + session->add_command (new StatefulDiffCommand (playlist)); + session->commit_reversible_command (); +} diff --git a/libs/ardour/test/profiling/sessions/1region/1region.ardour b/libs/ardour/test/profiling/sessions/1region/1region.ardour new file mode 100644 index 0000000000..b846225009 --- /dev/null +++ b/libs/ardour/test/profiling/sessions/1region/1region.ardour @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/ardour/test/profiling/sessions/1region/1region.ardour.bak b/libs/ardour/test/profiling/sessions/1region/1region.ardour.bak new file mode 100644 index 0000000000..ff17374272 --- /dev/null +++ b/libs/ardour/test/profiling/sessions/1region/1region.ardour.bak @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/ardour/test/profiling/sessions/1region/1region.history b/libs/ardour/test/profiling/sessions/1region/1region.history new file mode 100644 index 0000000000..d836783943 --- /dev/null +++ b/libs/ardour/test/profiling/sessions/1region/1region.history @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libs/ardour/test/profiling/sessions/1region/1region.history.bak b/libs/ardour/test/profiling/sessions/1region/1region.history.bak new file mode 100644 index 0000000000..6dd2506a89 --- /dev/null +++ b/libs/ardour/test/profiling/sessions/1region/1region.history.bak @@ -0,0 +1,2 @@ + + diff --git a/libs/ardour/test/profiling/sessions/1region/instant.xml b/libs/ardour/test/profiling/sessions/1region/instant.xml new file mode 100644 index 0000000000..6ee1811962 --- /dev/null +++ b/libs/ardour/test/profiling/sessions/1region/instant.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + -- cgit v1.2.3