1 -- [disable CPU freq scaling for benchmark]
4 -- record 2-3 mins on each track starting at 00:00:00:00
5 -- rewind the playhead to 00:00:00:00
6 -- run this script in Menu > Window. Scripting 10 times
7 ardour { ["type"] = "EditorAction", name = "Split Benchmark" }
9 function factory (params) return function ()
11 function split_at (pos)
12 local add_undo = false -- keep track if something has changed
13 Session:begin_reversible_command ("Auto Region Split")
14 for route in Session:get_tracks():iter() do
15 local playlist = route:to_track():playlist ()
16 playlist:to_stateful ():clear_changes ()
17 for region in playlist:regions_at (pos):iter () do
18 playlist:split_region (region, ARDOUR.MusicSample (pos, 0))
20 if not Session:add_stateful_diff_command (playlist:to_statefuldestructible ()):empty () then
25 Session:commit_reversible_command (nil)
27 Session:abort_reversible_command ()
31 function count_regions ()
33 for route in Session:get_tracks():iter() do
34 total = total + route:to_track():playlist():region_list():size()
40 local playhead = Session:transport_sample ()
42 local step = Session:samples_per_timecode_frame()
45 local t_start = ARDOUR.LuaAPI.monotonic_time ()
47 split_at (playhead + step * i)
49 local t_end = ARDOUR.LuaAPI.monotonic_time ()
51 Session:request_locate((playhead + step * n_steps), false, 5)
52 print (count_regions (), (t_end - t_start) / 1000 / n_steps)
54 ARDOUR.LuaAPI.usleep(500000)