-
Notifications
You must be signed in to change notification settings - Fork 70
feat: minibench -> add #178
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
Conversation
While I think you are probably right in that this will be faster, I would like to see benchmarks of this version versus the previous one before approving. |
@hdgarrood how would you suggest approaching this? the benchmarks are not implemented in the repo |
PureScript minibench is in core https://github.com/purescript/purescript-minibench, but I don't know if it already has a transitive dependency on arrays. |
before
after
O_O |
You should verify that you are running node with |
Huh! |
I think the thing you have to remember about ST is that even with magic-do, you are going to be allocating lots of Effect closures, which can be significantly more than whatever immutable data you are allocating (this depends greatly on the algorithm though). ST needs |
with before
after
|
which are not implemented, right? I'll try with ffi |
this one 2x better
|
Unfortunately we can't depend on |
@hdgarrood what to do? |
how about this
|
Actually I think the nullable dependency is probably less of an issue than the implementation you've gone with here, specifically the fact that it's completely FFI-based. We should really be moving in the direction of using less FFI in this code, as using the FFI for things like this causes pain for alternate backends (as they would then need to implement |
We definitely shouldn't depend on the |
@hdgarrood where can I find issue about adding |
I don't think we have an issue for it - there isn't much discussion of it so far. The idea would be that we have a collection of data types like
and so on, like
and so on, so that code like ST.run do
arr <- STArray.new
_ <- runSTFn2 STArray.push arr 3
pure (STArray.unsafeFreeze arr) might compile to something like function () {
var arr = STArray.new();
Data_Array_ST.push(arr, 3);
return unsafeFreezeImpl(arr);
} where |
@hdgarrood done |
I'll approve once these last two points are addressed - thanks! |
@hdgarrood everything fixed |
I've fixed the merge conflicts by updating dependencies to |
Is this ready to merge then? |
Ping |
No description provided.