Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor Memory Manager performance #3865

Closed
lukas-w opened this issue Oct 9, 2017 · 3 comments
Closed

Poor Memory Manager performance #3865

lukas-w opened this issue Oct 9, 2017 · 3 comments
Assignees
Milestone

Comments

@lukas-w
Copy link
Member

lukas-w commented Oct 9, 2017

MemoryManager causes a performance regression and should be replaced by a faster algorithm or, if we fail to find/implement one, just malloc and free, which still provides better performance than the current implementation.

Here are a couple of existing lock-free allocators I found:

Related issues: #2029, #3312, #3767

@lukas-w lukas-w added this to the 1.2.0 milestone Oct 9, 2017
@PhysSong
Copy link
Member

PhysSong commented Oct 9, 2017

Though I don't have a precise benchmark result, MemoryManager::alloc() seems to take average >100μs per allocation(depends on how long have LMMS been run), and it gets worse when I keep using LMMS.
IMO new memory manager doesn't strictly need to be lock-free, but it should be fast enough and guarantee suitable worst-case performance.

@softrabbit
Copy link
Member

Though I don't have a precise benchmark result, MemoryManager::alloc() seems to take average >100μs per allocation(depends on how long have LMMS been run), and it gets worse when I keep using LMMS.

I have a benchmark. Using the code in #3882 I exported the same file from the GUI using the default export settings, first with MemoryManager:

Real Time: 32.93, User Time 67.99, System Time 15.32
Real Time: 35.36, User Time 75.25, System Time 15.18
Real Time: 39.34, User Time 81.92, System Time 16.12
Real Time: 43.00, User Time 88.04, System Time 16.53

See the slowdown on each successive run? Then a version using malloc & free instead:

Real Time: 19.81, User Time 43.14, System Time 14.27
Real Time: 19.73, User Time 42.96, System Time 14.49
Real Time: 19.86, User Time 43.95, System Time 14.73

I was so sure that my malloc/free hacking had left out something important that I listened to the exported wav file but no, it was fine... using MemoryManager the export took around 50% longer and got slower all the time. Kill it. Kill it now. Nuke it from orbit.

lukas-w added a commit that referenced this issue Oct 18, 2017
* Replace MemoryManager implementation with rpmalloc
    Fixes #3865
* Travis: Specify OSX image for Qt5 build
PhysSong pushed a commit to PhysSong/lmms that referenced this issue Oct 29, 2017
* Replace MemoryManager implementation with rpmalloc
    Fixes LMMS#3865
* Travis: Specify OSX image for Qt5 build
PhysSong pushed a commit to PhysSong/lmms that referenced this issue Oct 29, 2017
* Replace MemoryManager implementation with rpmalloc
    Fixes LMMS#3865
* Travis: Specify OSX image for Qt5 build
@follower
Copy link
Contributor

follower commented Nov 7, 2017

I appreciate that the Compiling Wiki docs were updated but FWIW IMO this was a pretty major change to land on the "stable" branch without at least including a note in the commit message that the addition was via a submodule so things wouldn't automatically continue to work.

Or maybe I just have exceptionally bad luck to hit this change, b621c7e and 0dbdafc all within a short time affecting both stable & master. :/

sdasda7777 pushed a commit to sdasda7777/lmms that referenced this issue Jun 28, 2022
* Replace MemoryManager implementation with rpmalloc
    Fixes LMMS#3865
* Travis: Specify OSX image for Qt5 build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants