edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Adam Thompson <arthompson1990@gmail.com>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] JS1
Date: Fri, 11 Aug 2017 07:46:54 +0000	[thread overview]
Message-ID: <20170811074654.GB15710@odin> (raw)
In-Reply-To: <20170628180519.eklhad@comcast.net>

On Fri, Jul 28, 2017 at 06:05:19PM -0400, Karl Dahlke wrote:
> > They're kind of authogonal and kind of not. With the separate process we can
> > keep spinning round the main input loop even if js is stuck in some expensive
> > operation.
> 
> In theory we could, but today we don't.
> I send a message over pipe to js process and block read waiting for a response.
> Things to consider though: 1. websites aren't going to write js code that computes a million digits of pi, at least not on purpose.
> I don't believe there are that many js expensive operations out in the wild.
> That's why I didn't mind waiting for the response.
> Second, I'm calling up the web page and I want to read the page, that is next on my list of things to do,
> I really don't want to go off to another buffer and do something else.
> If it's really that slow I'm going to be annoyed, whether I have the freedom to switch buffers while I wait or not.
> It just shouldn't be that slow.
> A measure of the quality of a mainstream browser is often how quickly it can bring up complex sweb pages.
> 3, so far the times it has been really slow is our fault, our DOM was not correct or complete and that caused js to go into a long loop, sometimes an infinite loop,
> and that wouldn't happen on another browser or on edbrowse if we had all our objects correct.

Agreed.

> Speaking of serialized poling and timers,
> one thing I had to do was scale back the intervals, so they can't fire 20 times a second,
> as they do on some sites for visual effects.

Since some of these timers aren't for visual effects (polling, checking that
aspects of the DOM are correct etc) I had a quick look at the timers code
yesterday.  I have a version of the code with the 10 ms minimum as per the spec
and I've altered the code to run a single timer then spin round the loop again.
This appears to work in testing since what happens is that we run one of the very
fast timers, call select again, detect that we don't have input and that we have
timers waiting then run the next one.  In the case that we have input we read it
then spin back round and catch the fact that we have timers pending.  I'm not
sure if this exposes any new corners but it's available in:
https://github.com/arthompson/edbrowse.git
I can push the changes into the edbrowse main repo if people are happy.

Cheers,
Adam.
PS: I'm now running js in 1-process mode so that's how I've tested it.  I've
spun it up in 2-proc mode but I've not extensively tested it.

  reply	other threads:[~2017-08-11  7:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-23  2:49 Karl Dahlke
2017-07-24 17:57 ` Adam Thompson
2017-07-28 17:39   ` Karl Dahlke
2017-07-28 19:51     ` Adam Thompson
2017-07-28 22:05       ` Karl Dahlke
2017-08-11  7:46         ` Adam Thompson [this message]
2017-08-11  9:51           ` Karl Dahlke
2017-08-12  7:20             ` Kevin Carhart
2017-08-12  7:30               ` Karl Dahlke
2017-08-12  8:06                 ` Kevin Carhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170811074654.GB15710@odin \
    --to=arthompson1990@gmail.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).