-
Notifications
You must be signed in to change notification settings - Fork 107
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
Heap growth strategies #771
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
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 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]>
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
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 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]>
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
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 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]>
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
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 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]>
pguyot
force-pushed
the
w33/heap-growth-strategies
branch
from
August 20, 2023 20:50
801b4bc
to
07cb05a
Compare
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
Aug 21, 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 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]>
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
Aug 21, 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 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]>
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
Aug 24, 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 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]>
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
Aug 25, 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 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]>
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
Aug 25, 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 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]>
pguyot
force-pushed
the
w33/heap-growth-strategies
branch
2 times, most recently
from
August 27, 2023 05:41
7bdab8c
to
fd06c29
Compare
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
Aug 27, 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 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]>
pguyot
added a commit
to pguyot/AtomVM
that referenced
this pull request
Aug 27, 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 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
added a commit
that referenced
this pull request
Sep 1, 2023
Optimize usage of temporary stack by allocating first words on C stack This change, combined with a Fibonacci heap growth strategy (#771), approximatively divides execution time by two with the 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
bettio
added a commit
that referenced
this pull request
Sep 1, 2023
…ule-index Reduce lock contention on GlobalContext.module_locks 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
pguyot
force-pushed
the
w33/heap-growth-strategies
branch
from
September 7, 2023 16:55
fd06c29
to
7836b02
Compare
bettio
requested changes
Sep 8, 2023
pguyot
force-pushed
the
w33/heap-growth-strategies
branch
2 times, most recently
from
September 8, 2023 18:14
053fe93
to
2f3ed6e
Compare
Strategies can be selected with `spawn_opt/2,4` and affect how heap is grown. Three strategies are implemented: - bounded free: keep free space within bounds (this is the old implementation) - minimum: always try to mimimize free space - fibonacci: grow heap following fibonacci up to a certain point (inspired from Erlang/OTP) Also fix allocation with min_heap_size (a bug in strategy generated a lot of useless garbace collections). Also fix semantic of `heap_size` for process_info and add `total_heap_size`. Signed-off-by: Paul Guyot <[email protected]>
pguyot
force-pushed
the
w33/heap-growth-strategies
branch
from
September 10, 2023 18:40
2f3ed6e
to
30259fe
Compare
bettio
approved these changes
Sep 14, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Strategies can be selected with
spawn_opt/2,4
and affect how heap is grown.Three strategies are implemented:
(inspired from Erlang/OTP)
Also fix allocation with min_heap_size (a bug in strategy generated a lot of
useless garbage collections).
Also fix semantic of
heap_size
for process_info and addtotal_heap_size
.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