-
Notifications
You must be signed in to change notification settings - Fork 15
HAMT Performance Improvements #54
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
Draft
ssoelvsten
wants to merge
32
commits into
TroupeLang:dev-integrity
Choose a base branch
from
ssoelvsten:fork/dev-integrity/hamt
base: dev-integrity
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
HAMT Performance Improvements #54
ssoelvsten
wants to merge
32
commits into
TroupeLang:dev-integrity
from
ssoelvsten:fork/dev-integrity/hamt
Conversation
This file contains hidden or 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
These are not per se testing the runtime itself. Rather, they are checking that the standard library actually is correct. Furthermore, the 'hamt_stress.trp' and 'hamt_perf.trp' tests include timing the time to run certain operations. These break on other machines (and presumably also on the same machine).
The git history already documents the fact these functions are 'optimized'...
And once again, make the make target match the convention of also matching the folder's name.
According to an SO post (https://stackoverflow.com/a/41537995/13300643), the other value is a prime number pretty close to the original value. Yet, using that one instead breaks many of the intended properties of the hash function
This is done by emulating the actual original Knuth's multiplicative hash function (fixed for data structures of 2^31 size... or less)
This makes it larger than (most) ASCII characters. This should decrease the number of collisions that happens with any regular string.
This also makes it use a Mersenne prime rather than just a power of two.
929de88
to
ff53745
Compare
As you can see, Claude, I got questions...
d4f33ca
to
78e0e98
Compare
78e0e98
to
b7736bd
Compare
b7736bd
to
49b21d0
Compare
This way, if someone else has a `filter`, `map`, and so on, you can still access these functions. Like in SML, the `length` function is exported both as `List.length` and `length`.
49b21d0
to
b7d14a1
Compare
2d23590
to
c7a2886
Compare
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.
So, I've been looking at the current state of the HAMT. For now, here are all of the associated cleanups I've made.
Makefile
stest/lib
for Standard Libraryhash
function into its own Standard Library module for separate testing and reuse.hash
functions.Here is my roadmap to continue:
List
library use namespaced style (such that there are no conflicts with "overloading" from other parts of the standard library).length
is still also exported into the global namespace.Unit
library - depends(ish) on Library is imported as a closure rather than an array #55StencilVector.trp
(useful for separate testing)Map.trp
Set.trp