Fork me on GitHub
#cljsrn
<
2020-01-17
>
Eric Ihli22:01:36

I'm curious if anyone would know of this to be a problem.

(defmacro slurp [file]
  (clojure.core/slurp (io/file (io/resource file))))
(ns ezmonic.e-data
  (:require [cljs.reader :as reader])
  (:require-macros [ezmonic.util :refer [slurp]]))

(defonce data
  (reader/read-string (slurp "number-to-word-tree.edn")))
I'm using that to read a 6MB file. Everything works fine in the emulator. But, when I create a release bundle and install it on my phone, the app freezes for 10 seconds when going to and coming from the background. I would have expected that if this were going to be slow then it would have been slow on app startup and not every time the app is sent to/recovered from the background.

joshmiller22:01:26

Is it possible that your phone has to do a bunch of work to serialize/deserialize the app’s state to disk on sleep/wake?

joshmiller22:01:47

My first guess is that something else is going on, but you could always test it out by making a test app that does nothing except that and seeing what happens.