phonegap build and phonegap.js compression

  • 1
  • Question
  • Updated 5 years ago
  • Answered
Hi;
using PGB it looks like the phonegap.js file is not compressed. is this something that impacts the app performance?
Photo of gkatz

gkatz

  • 186 Posts
  • 5 Reply Likes
  • undecided

Posted 9 years ago

  • 1
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
Not necessarily. JavaScript compression is most important for network performance - web applications that are requesting files from remote servers need to wait for the file to be downloaded, so having a smaller file makes the process a lot smoother.

What matters on mobile devices, and PhoneGap apps specifically, is memory, rather than network traffic. While you may get some memory benefits from running a minified JS file, both the original and the minified file are interpreted into the same code*, so the difference is negligible.

In most cases, minifying JavaScript is low on the list of priorities for a PhoneGap application.

* there are some preprocessors - most notably Google Closure Compiler - that can affect the runtime performance of the code as well.
Photo of rene.vaessen

rene.vaessen

  • 114 Posts
  • 4 Reply Likes
I know this topic is old,

but who knows, someone might still reply :)

Does anyone know, if Apple would have problems when you minified your javascript in your PhoneGap application?

I mean, does doing so, complicate their code-review process, or don't they care, for reasons that have to do with their automated reviewing methods?

I don't care if they see, my code, would even prefer it, so they can see, it's all decent, but it involves modifing my publishing and optimilization routines.. And if I don't have to, I guess I won't.

Thanks for any comment you might have.
Photo of Andrew Lunny

Andrew Lunny

  • 1911 Posts
  • 199 Reply Likes
I'm pretty sure Apple would not have a problem with that.

They usually (to my knowledge) assess your app by using it, and by scanning the binary for undocumented native API calls.
Photo of rene.vaessen

rene.vaessen

  • 114 Posts
  • 4 Reply Likes
Ok, I see.

thanks for your input!

cheers,

René
Photo of Ameed Uddin

Ameed Uddin

  • 1 Post
  • 0 Reply Likes
how do i create a zip for a selected file in phonegap????
plz reply and thanks in advance.
Photo of tonytong

tonytong

  • 1 Post
  • 0 Reply Likes
i find a free online tool to minify javascript.