lilactown / pyramid

A library for storing and querying graph data in Clojure
Eclipse Public License 2.0
228 stars 10 forks source link

Trampoline #16

Closed lilactown closed 2 years ago

lilactown commented 2 years ago

Building off of https://github.com/lilactown/pyramid/pull/15, this PR rewrites the essential algorithm to use continuation-passing style and trampoline in order to avoid using the call stack.

On my personal laptop, this results in slighty slower runtime than the one in #15 using the callstack, but descends over 40,000 before overflowing vs a measly ~3,000, and is still faster than the broken version in the main branch.