Results 1 to 9 of 9

Thread: JavaScript Web Apps and CPU / RAM usage

  1. #1
    Join Date
    Apr 2011
    Location
    Slovenia
    Beans
    83
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Question JavaScript Web Apps and CPU / RAM usage

    There was this Ubuntu App Showdown, and there were applications posted that were made with JavaScript + HTML + CSS, so web apps, which were put into a WebKit window made with Python.
    In the discussion about the applications I saw some people complaining that the apps can have a pretty big CPU and RAM usage if I remember right(even the small lightweight applications).

    Is this true and what can be done to possibly prevent or lower those two?
    Last edited by snowz; July 20th, 2012 at 09:36 AM. Reason: Change of font XD

  2. #2
    Join Date
    Apr 2009
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: JavaScript Web Apps and CPU / RAM usage

    I would guess that the CPU usage is due to single thread Javascript stuff. Multi threading is something new in that environment, and probably not widely used. RAM usage is due to all three (Javascript, HTML, CSS) in an engine - Webkit in this case - plus whatever Python wrapper might use. No small things, those, I would say. I doubt much can be done to lessen their demands when it comes to web app kind of stuff.

  3. #3
    Join Date
    Apr 2011
    Location
    Slovenia
    Beans
    83
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: JavaScript Web Apps and CPU / RAM usage

    Thanks for your response

  4. #4
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: JavaScript Web Apps and CPU / RAM usage

    Quote Originally Posted by Dimarchi View Post
    I would guess that the CPU usage is due to single thread Javascript stuff. Multi threading is something new in that environment, and probably not widely used. RAM usage is due to all three (Javascript, HTML, CSS) in an engine - Webkit in this case - plus whatever Python wrapper might use. No small things, those, I would say. I doubt much can be done to lessen their demands when it comes to web app kind of stuff.
    Event driven apps, multithread or not, don't use CPU between events. These days any app that needlessly burns CPU has very little future, because is draws on batteries...

  5. #5
    Join Date
    Apr 2011
    Location
    Slovenia
    Beans
    83
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Question Re: JavaScript Web Apps and CPU / RAM usage

    If being portable is the key, then it might represent a battery problem yeah. If portability isn't that much the main goal then it's the applications performance for sure.

    Lets compare, if an application is written in JavaScript, does it use more CPU as if it would be done in Python + GTK because of its HTML + CSS interface?

  6. #6
    Join Date
    Apr 2009
    Location
    Germany
    Beans
    2,134
    Distro
    Ubuntu Development Release

    Re: JavaScript Web Apps and CPU / RAM usage

    it depends what the application does
    javascript is probably faster than python because its VM's are so very optimized.
    on the other hand its easier in python to offload heavy workload into optimized C code.

    and as mentioned gui's are normally event driven applications which don't use any cpu at all unless you actually do something, no matter if written in javascript or python/C.

  7. #7
    Join Date
    Apr 2011
    Location
    Slovenia
    Beans
    83
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Post Re: JavaScript Web Apps and CPU / RAM usage

    @MadCow108 Thanks for the reply

  8. #8
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    2,172
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: JavaScript Web Apps and CPU / RAM usage

    Quote Originally Posted by snowz View Post
    If being portable is the key, then it might represent a battery problem yeah. If portability isn't that much the main goal then it's the applications performance for sure.

    Lets compare, if an application is written in JavaScript, does it use more CPU as if it would be done in Python + GTK because of its HTML + CSS interface?
    All applications are portable these days... they all run on laptops, and laptops are becoming a vast majority of end-users computers. An app can burn CPU cycles, but for good purpose...

    From a battery point of view, I doubt there is much difference between two well written apps in either language.

  9. #9
    Join Date
    Apr 2011
    Location
    Slovenia
    Beans
    83
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: JavaScript Web Apps and CPU / RAM usage

    Quote Originally Posted by ofnuts View Post
    From a battery point of view, I doubt there is much difference between two well written apps in either language.
    Oh ok, thanks.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •