-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hi,
I've been expermenting with hconsing with NBE for lambda calculus. This library is the primary inspiration, which I've mostly copied. Originally, I was using the library, but ran into some performance problems:
- I believe the
uidis not needed, the internalNonNullpointer data in theRcis enough to act as a unique reference. As everyRcis the spoke on a fuzzy ball surrounding aRcBox, even if the location of theRcBoxwere to somehow move, it must move in a way such that all constructedRc's remain sound. Of course, theWeakstored in theHConsignhas the same properties, because it references the sameRcBox. Moreover, once the pointer is reclaimed, that is the exact condition in which the unique id would be reusable because the originalWeakwould fail to upgrade. - The usage of
Arcwith no ability to switch to anRc. In my case, there is no point in being multithreaded. Parallelization in evaluating lambda terms is not very good unless you take an optimal lambda evaluator route.
"Fixing" those two problems were about a 2-3x speedup for my benchmarks, especially because lambda terms are explosive in terms of size, so halving the pointer size ends up being a useful win.
Ideally, I'd like these changes to make it into this library, because then I can just pull it from cargo :)
Unrelated, I would prefer if the pointer types where called Hc and Ahc, but this is a minor thing that is not important to me, I can just rename the types in my project.
If you are interested I could draft a PR with the above changes.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels