newsAdvanced Gtk+ Sequencer - News: Constant CPU consumption by bisection

 
 
Latest News
GSequencer v3.6.x release goals posted by jkraehemann, Fri 31 Jul 2020 10:17:04 AM UTC - 0 replies
GSequencer v3.4.x release goals posted by jkraehemann, Thu 11 Jun 2020 06:58:14 PM UTC - 0 replies
GSequencer v3.3.x replaced all recalls by ags-fx engine posted by jkraehemann, Wed 20 May 2020 07:25:15 AM UTC - 0 replies
Refactor GSequencer's recalls - the ags-fx engine posted by jkraehemann, Sun 03 May 2020 12:08:19 AM UTC - 0 replies
GSequencer v3.3.x release goals posted by jkraehemann, Fri 17 Apr 2020 12:36:11 PM UTC - 0 replies
[Submit News]
[97 news in archive]

Constant CPU consumption by bisection

Item posted by Joël Krähemann <jkraehemann> on Tue 05 Feb 2019 05:12:51 PM UTC.

For short, I am just refactoring some parts of:

  • AgsNotation
  • AgsAutomation
  • AgsWave

to do bisection x-offset. This shall result in better performance and more constant CPU consumption.

Prior, I recognized as doing low-latency playback using AgsWave, to encounter bottlenecks. This was solved by refactoring:

ags_wave_find_point()

This function does bisection as of Advanced Gtk+ Sequencer version 2.1.38.

The refactoring

I just implemented:

ags_notation_find_offset()

... returning a GList containing all x-offset matching AgsNote objects. It uses bisection to find matches.

Another refactored function is:

ags_automation_get_value()

So guess, it does bisection, now.

Bisection segments

For now, I work on refactoring:

ags_notation_find_near_timestamp()
ags_automation_find_near_timestamp()
ags_wave_find_near_timestamp()

Doing bisection segments is going to provide enormous performance payback as doing continues playback/recording. Because the algorithm looks at the first, last and center element.

Especially recording benefits of this, since the last segment is lookup very fast.

Since all these functions involve mutexes, the lock count is more constant and is slightly reduced during playback.


by Joël

No messages in Constant CPU consumption by bisection

 

Back to the top


Powered by Savane 3.5