Fork me on GitHub
#cljs-dev
<
2015-08-04
>
mikethompson02:08:33

@dnolen: would you consider a patch to core.async so that (<! (timeout 0)) got as close to 0 as possible. Currently (<! (timeout 0)) will take about 4ms on a modern browser because it ends up as (js/setTimeout f 0) which, on a modern browser means about a 4ms delay, and that's too long if you are just wanting to hand back control to the browser for the minimum about of time. See: https://github.com/clojure/core.async/blob/d073896192fa55fab992eb4c9ea57b86ec5cf076/src/main/clojure/cljs/core/async/impl/timers.cljs#L161-L164 followed by: https://github.com/clojure/core.async/blob/d073896192fa55fab992eb4c9ea57b86ec5cf076/src/main/clojure/cljs/core/async/impl/dispatch.cljs#L35-L36 I was imagining the following tiny rewrite:

(defn queue-delay [f delay]
   (if  (= 0 delay) 
      (goog.async.nextTick f)      ;;  <---- new path for 0
     (js/setTimeout f delay))

mikethompson02:08:06

Uggh. This got a bit long, sorry. Should be a ticket. But just wondered if it would be considered by you as worthwhile before I go to the effort of a ticket.

dnolen10:08:36

@mikethompson: I am not really the person to talk to about core.async

martinklepsch11:08:24

@dnolen: seeing the Closure bump in cljs: how do you package up closure? I remember that you said stuartsierra does it? is that process documented somewhere?

dnolen11:08:57

@martinklepsch: you mean Closure Library, yeah there’s some simple deploy steps for that in Hudson

martinklepsch11:08:04

I think for CLJS people wanting to hack on Closure itself it’d be neat to know simple_smile

dnolen11:08:42

ah building it locally is another thing.

dnolen11:08:39

@martinklepsch: script/closure-library-release/closure-library-release.sh

martinklepsch11:08:48

Ah cool. Thanks! simple_smile

dnolen13:08:27

@martinklepsch: I fixed that script so that it installs to local Maven if not on Hudson

dnolen13:08:35

should simplify testing considerably simple_smile

martinklepsch14:08:41

@dnolen: thanks good to know simple_smile