dwyl / learn-elm

:rainbow: discover the beautiful programming language that makes front-end web apps a joy to build and maintain!
https://github.com/dwyl/learn-elm
483 stars 43 forks source link

How does compiling in DEV mode affect performance? #136

Open iteles opened 5 years ago

iteles commented 5 years ago

I have seen some production Elm apps still 'compiling in dev mode', presumably either because this was forgotten or because someone is still working actively on them.

image

How does this affect performance if at all? Does it have any negative effects in production?

yousefvand commented 5 years ago

According to documentation (or you can use: elm make --help) the --optimize switch does at least two things:

  1. Renaming variables so the overall size of app reduces (Also it can be considered as basic obfuscation if you are concerned about your code being reverse engineered.
  2. Unboxing values which means less memory resumption and faster code due to less memory lookup.

So how much --optimize is beneficial differs form app to app and needs extra benchmarking on app for a precise measure.