Commit Graph

14 Commits

Author SHA1 Message Date
Paul Licameli 64d7ca7403 New utility library 2021-06-02 07:08:19 -04:00
Paul Licameli e6e96de0fd Replace most inclusions of MemoryX.h with <memory> ...
... Most often it was needed for a custom definition of std::make_unique, but
we build C++14 now.
2021-06-02 07:08:19 -04:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
Yuri Chornoivan d1ada5f08c Fix minor typos 2020-04-11 10:06:24 +01:00
Paul Licameli a461b7a273 Possible fix for intermittent assertion violations at Linux startup 2020-02-29 17:13:53 -05:00
Paul Licameli 2570b56176 Rename Maybe and its members more like std::optional of C++17 2020-01-19 11:38:12 -05:00
Paul Licameli 3a1456bf53 Make OverlayPanel independent of AColor 2019-07-13 16:08:29 -04:00
Paul Licameli 227fb315ea Drawing sequence for overlays independent of insertion call sequence 2019-05-20 21:38:08 -04:00
Paul Licameli 173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli f7162d3326 OverlayPanel uses weak_ptr to Overlay, which simplifies other dtors 2019-03-16 08:21:03 -04:00
Paul Licameli a73970d864 Rewrite the quick exit test in OverlayPanel::DrawOverlays 2019-03-16 08:07:09 -04:00
Svyatoslav 31b820b47c src/widget/OverlayPanel: PVS-Studio: fixes bug with remove function. 2017-10-11 14:16:33 +03:00
Raphaël Marinier 173652875d Reduced CPU usage of Audacity when idle.
Before this change, an idle Audacity on a recent Linux laptop uses 6%
of CPU. This is because DrawOverlays() is called every 50ms through a
timer in TrackPanel, which instanciates a wxClientDC. This is quite
expensive and dominates the profiles: creating wxClientDCs is 84% of
the CPU audacity spends while idle, according to callgrind. With this
change, we avoid creating wxClientDCs when it's not necessary.

After this change, and idle Audacity consumes 1.6% of CPU, and most of
the time is spend in gtk/wxwidgets processing events.

Here are the perf stats of an idle Audacity before the change:

        524.425485      task-clock (msec)         #    0.060 CPUs utilized
               825      context-switches          #    0.002 M/sec
                36      cpu-migrations            #    0.069 K/sec
                 0      page-faults               #    0.000 K/sec
     1,198,433,346      cycles                    #    2.285 GHz
     1,243,329,771      instructions              #    1.04  insn per cycle
       308,073,049      branches                  #  587.449 M/sec
         5,801,494      branch-misses             #    1.88% of all branches

       8.808129958 seconds time elapsed

and after:

        149.110455      task-clock (msec)         #    0.016 CPUs utilized
               908      context-switches          #    0.006 M/sec
                32      cpu-migrations            #    0.215 K/sec
                 0      page-faults               #    0.000 K/sec
       313,372,582      cycles                    #    2.102 GHz
       167,401,770      instructions              #    0.53  insn per cycle
        41,857,947      branches                  #  280.718 M/sec
         1,189,566      branch-misses             #    2.84% of all branches

       9.076940003 seconds time elapsed
2016-07-21 23:07:33 +02:00
Paul Licameli 7c2a531486 New base classes of TrackPanel just for the bitmap backing and overlay system...
... to make it reusable by other classes.

Also, don't create a second DC when repainting TrackPanel.
2016-05-09 11:37:32 -04:00