Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31391

Re: Parsing javascript file off the main thread

Newsgroups comp.lang.javascript
Subject Re: Parsing javascript file off the main thread
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <fa9f1a4a-1f09-4ff0-9f23-d249dea58a52@googlegroups.com> <XnsA685B44AE407Eeejj99@194.109.6.166> <545f44f8-d33a-4036-b7ef-143f7a62b169@googlegroups.com>
Date 2016-09-17 10:47 +0200
Message-ID <XnsA6866DCAC1529eejj99@194.109.6.166> (permalink)

Show all headers | View raw


Georg Kothmeier <georgkothmeier@gmail.com> wrote on 17 Sep 2016 in
comp.lang.javascript: 
> To clearify what I mean: 

This is Usenet, not email, nor a Google group,
so please for the group and according to Netiquette,
quote what you are replying on!

> by source, I mean the JavaScript file which is sent to the browser. This
> is already minified and in ASM.js format. 

So that is the 'Javascipt script'. Mimifying is not apparent to the 
executing engine, it just speeds up the transmission, and gives an illusion 
of encription to the unwary.
 
> By parsing I mean the step which is done by the browser when the
> JavaScript file is interpreted and compiled to some kind of byte code
> which then is used by the browser to run the code. 

In my vocabulary, 'compiling' is producing an executable code that can be 
distributed. Javascript in browsers does not work like that, imho.

That is why it is a 'script' and not a 'source'. Scripts are executed by an 
execution engine.

'Scripts', in the usual parlance, are executed as is, or though an 
intermediate code that is made u[p real-time and destroyed immediately after 
use, and are probably not readable by another type of execution engine, 
depending on the specific browser and version.

> And by "off the main thread" I mean, a mechanism of parsing/compiling
> which does not block the whole UI. 

'UI' meaning 'browser UI'?

Present Javascript engines in browsers, AFAIK, are still single-threaded.

You must give the illusion of 'non freezing up' by clever coding, giving the 
user someting to do, see or read, or dividing up the 'parsing'. Google is 
rather clever in that in its large applications, mesupposes.

> So basically to switch the
> parsing/compiling to some background thread, away from the main thread. 

There is no compiling, the 'parsing' is done in real time, that's why it is 
called a 'script' and not a 'source'.

> Does this make sense?

Yes, but for the missing quote. Usenet servers are not time-coherent in the 
sense that they maintain order in the messages, so quoting is essential to 
maintain a thread. 

> If not I'll try to explain it better

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Parsing javascript file off the main thread georgkothmeier@gmail.com - 2016-09-16 06:29 -0700
  Re: Parsing javascript file off the main thread "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-09-16 17:43 +0200
    Re: Parsing javascript file off the main thread Georg Kothmeier <georgkothmeier@gmail.com> - 2016-09-16 16:16 -0700
    Re: Parsing javascript file off the main thread Georg Kothmeier <georgkothmeier@gmail.com> - 2016-09-16 16:18 -0700
      Re: Parsing javascript file off the main thread "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-09-17 10:47 +0200
  Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-18 10:55 -0700
    Re: Parsing javascript file off the main thread Georg Kothmeier <georgkothmeier@gmail.com> - 2016-09-19 00:28 -0700
      Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-19 08:15 -0700
        Re: Parsing javascript file off the main thread Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-19 19:46 +0200
          Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-19 11:00 -0700
            Re: Parsing javascript file off the main thread Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-19 20:42 +0200
              Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-19 11:53 -0700
                Re: Parsing javascript file off the main thread Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-20 00:01 +0200
                Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-20 12:02 -0700
                Re: Parsing javascript file off the main thread Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-20 21:26 +0200
                Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-20 17:38 -0700
                Re: Parsing javascript file off the main thread Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-22 06:46 +0200
                Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-22 05:53 -0700
                Re: Parsing javascript file off the main thread Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-09-23 02:42 +0200
                Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-23 09:29 -0700
                Re: Parsing javascript file off the main thread "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2016-09-20 12:00 -0700
                Re: Parsing javascript file off the main thread Scott Sauyet <scott@sauyet.com> - 2016-09-21 02:24 +0000

csiph-web