Skip to content
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

Seems to hang on infinite sequences #15

Closed
tekacs opened this issue Nov 9, 2021 · 1 comment
Closed

Seems to hang on infinite sequences #15

tekacs opened this issue Nov 9, 2021 · 1 comment

Comments

@tekacs
Copy link

tekacs commented Nov 9, 2021

Replication steps

user.clj:

(ns user
  (:require [nextjournal.clerk :as clerk]))

(clerk/serve! {:watch-paths ["notebooks"]})

notebooks/tester.clj:

(range)

This seems to hang, rather than handling the infinite sequence as expected and called out in the example here:

Clerk server launched with Calva's jack-in, with no other dependencies. The Clerk server seems to just stop responding to updates.

On the other hand (range 100) seems to work fine.

@mk
Copy link
Member

mk commented Nov 9, 2021

Hey, thanks for the report! Clerk currently has a condition to not cache things that execute in under 1ms, see

(defn worth-caching? [time-ms]
(<= 1.0 time-ms))

and

(let [no-cache? (not (worth-caching? time-ms))]

Could you maybe experiment with raising that limit and printing the time in order to find out what a better threshold is?

I think we might also want to put some limits in place so we by default don't try to freeze uncountable seqs with a very large number of items.

@mk mk closed this as completed in 54ca847 Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants