-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Support for nbb #188
base: master
Are you sure you want to change the base?
Support for nbb #188
Conversation
It was simple to remove (assuming it works) and ring buffer isn't compatible with nbb.
needed for nbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a couple of comments regarding removing ring-buffer.
Apart from that, what I'm not sure is about how instrumentation would work for nbb since if I understand correctly it doesn't use Clojure or ClojureScript for compilation, it uses SCI to interpret Clojure right?
@@ -26,11 +25,11 @@ | |||
(rt-events/publish-event! (rt-events/make-last-evals-update-event last-evals-refs)))) | |||
|
|||
(defn clear-outputs [] | |||
(reset! *last-evals-results (ring-buffer 10)) | |||
(reset! *last-evals-results []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I added a ring-buffer here is because the ring-buffer library was already here for other functionality (see my comment below) and I think it looks cleaner
(defn grep-coll | ||
|
||
"Search over coll with pred, when it matches returns the | ||
A elements before and the B elements after" | ||
|
||
[coll A B pred] | ||
(loop [elems-before (ring-buffer A) | ||
(loop [elems-before [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I brought a ring-buffer for this only for performance reasons. If we change it like the proposed time will grow linearly on A, making it too slow for the current case.
On my box :
(def col (doall (repeat 10000000 :elem)))
(time (grep-coll col 1000 1 (constantly false))) ; ~ 1 sec
(time (grep-coll-without-ring-buffer col 1000 1 (constantly false))) ; ~ 207 sec
Very much a WIP