This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-08-13
Channels
- # aws (5)
- # bangalore-clj (2)
- # beginners (74)
- # boot (2)
- # cider (12)
- # cljs-dev (5)
- # cljsjs (2)
- # cljsrn (7)
- # clojure (41)
- # clojure-boston (4)
- # clojure-brasil (3)
- # clojure-russia (12)
- # clojurescript (73)
- # cloverage (35)
- # datomic (7)
- # euroclojure (1)
- # hoplon (34)
- # immutant (1)
- # luminus (9)
- # onyx (7)
- # overtone (3)
- # parinfer (1)
- # proton (2)
- # re-frame (3)
- # reagent (5)
- # spacemacs (5)
- # testing (2)
- # untangled (3)
- # yada (3)
Anyone out there experiencing UI jank due to computations that are occurring on the main thread? I couldn’t take it anymore, so I moved everything over to a worker thread and I’m quite pleased with the result. I’m sharing my code as a library in case anyone else finds it useful. The library is using re-frame
and react-native-workers
. Let me know what you think!
https://github.com/seantempesta/cljsrn-re-frame-workers
@seantempesta: Can you elaborate more about the problem? I thought ReactNative itself does everything on background thread
Native things render on the background thread. Navigation, animations, and list views are some of the things I’ve had problems with.
(those aren’t native and run in the javascript thread)
I started running into this problem on some of my views that had a lot of aggregate calculations. One change to the underlying data set and most things needed to be recalculated. Having the UI freeze every time that happens isn’t such a great UI experience.
I make some animated gifs that show it happening. You can also just run the example to see it for yourself. https://github.com/seantempesta/cljsrn-re-frame-workers/tree/master/examples/worker-test
ah, got it - you have heavy computation and it affects the UI. I’ll check the code, thank you