Fork me on GitHub
#cljsrn
<
2016-09-25
>
raspasov06:09:42

hey guys - I have a very first-world problem: any ideas why building a production release takes 2-3 minutes and any ways to speed it up? : ) Using RN + re-natal + Om.next - everything works otherwise!

artemyarulin06:09:34

well advanced compilation takes more time, but I’m actually not sure if re-natal use it for production build. Check project.clj cljsbuild optimisation level

raspasov06:09:57

I'm not actually using advanced compilation

raspasov06:09:23

:optimizations :simple

raspasov06:09:58

it's the "react-native bundle" command that takes a while

raspasov06:09:49

I used to do :optimizations :advanced, but couldn't get source maps to work in production, so I dropped it

raspasov06:09:03

because when a crash happens in production I am not good enough (yet) to figure out what does "h.q" means in the Google Closure code 😛

lxsameer13:09:59

is it ok to use subscribers or look up app-db's keys in event handlers

pesterhazy16:09:29

@raspasov the rn packager is simply slow

pesterhazy16:09:00

it also has to deal with more code than usual as it packages the whole cljs output

raspasov17:09:50

@pesterhazy: I figured - was just wondering if there's any way to speed it up; buy faster CPU? 😁

pesterhazy17:09:53

Actually prod build don't bother me much

pesterhazy17:09:03

How often do you do those?

pesterhazy17:09:42

But longer dev build slow down your feedback cycle

pesterhazy17:09:43

Screws up your interactive devenv

raspasov17:09:02

@pesterhazy: def not a deal breaker, but sometimes I want to test on multiple devices things like animation performance and the only way to truly gauge that is do a prod build, so I might do it a few times per day

raspasov17:09:13

It's like 2-3 min for me, after about 40-50 sec of CLJS compilation with :simple, so the whole process becomes like 3.5 minutes

pesterhazy17:09:31

wait until the packager starts randomly running of memory!

artemyarulin19:09:47

wouldn’t help much but I noticed that :optimizations :whitespace is faster comparing with :simple like 28s vs 38s on my app

artemyarulin19:09:22

also :parallel-build true may help, although it never gave any time boosts on any of my projects 😞