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

Reduce lock contention on GlobalContext.module_locks #773

Merged

Conversation

pguyot
Copy link
Collaborator

@pguyot pguyot commented Aug 20, 2023

Cache last module in scheduler loop to reduce lookups of modules by index
Also fix a bug in stacktraces where the lock was not held
Also remove pointer to GlobalContext from modules

This optimization, in addition to PRs #766, #770, #771 and #772, brings an additional gain of 2-3% on Sudoku benchmark

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

Cache last module in scheduler loop to reduce lookups of modules by index
Also fix a bug in stacktraces where the lock was not held
Also remove pointer to GlobalContext from modules

This optimization, in addition to PRs atomvm#766, atomvm#770, atomvm#771 and atomvm#772, bring an
additional gain of 2-3% on Sudoku benchmark

Signed-off-by: Paul Guyot <[email protected]>
@bettio bettio merged commit 70edffe into atomvm:master Sep 1, 2023
@pguyot pguyot deleted the w33/reduce-lock-contention-on-module-index branch September 2, 2023 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants