From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:400c:c09::243; helo=mail-wm0-x243.google.com; envelope-from=arthompson1990@gmail.com; receiver= Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by hurricane.the-brannons.com (Postfix) with ESMTPS id C49527A50C for ; Fri, 11 Aug 2017 00:46:20 -0700 (PDT) Received: by mail-wm0-x243.google.com with SMTP id x64so5550112wmg.1 for ; Fri, 11 Aug 2017 00:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=ayGZqaQCfjCrBMMMI5JFIsIU6KuZJOWxkhO3qcwABSI=; b=C6pvAu2j+II/+V0K0b7GTuaWFhSB365Yw+CWYFyQZ15RBcnZe7INDwn41LgCygQ1dy nbFCCOsju56dvHu6nHqBNjA1JybIKJD0beUcaTco8/fhw+Xa5805bnxAG1f6+j94JO8J MRUD/ThNn8CFBEDn56ssnPyjtah8JfiwaWGX3dFYJnxXQ63bqyPwZ1ehzM8nn9YMRuN4 8r4/eAVVnqDwpyq0SZOqwgZMEPPAw63N6B4K0x9YF0ZUc9ymYufc1DH8Ec6YWbki0O7Y i64ziy8nBRIhVOpZH1aUSQ1R938thRWWtq0WPLBoTAS1vS0PHrhpHoLtEV9yY2Pj2oSe 7L2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=ayGZqaQCfjCrBMMMI5JFIsIU6KuZJOWxkhO3qcwABSI=; b=RkslJNuVB9A08bGyT06GKoXH0JlgtW3KpX0b3VC1ij7ujll32ls9Nxd4kAYzQ2UDXJ GqIYD77m/soQMzrgvgX5E+AOoRr4CDskSodMugNm8+vHWdebrFbUX/IiOCMxSjhK6+Xx 1jZ3j5r4krplaClplDkTtcMdo+vljKW8aIJ0oP00M0qGfG1tx2ai39D2cUXhSKmt4td+ F0f9pS0C09PauujrevUuFS0O04T8OUn6P6/36Llp3PN0qxCQunpLqEbeKEf0UYzLDHfM wc83nAXRxGvZobMTrpBYBFfCaxNvPrRBO+Udd2n2yRSy/gHHLGkGR6m9F7r4d3yf3eVV 2PZQ== X-Gm-Message-State: AHYfb5hIivMdbotYPyNOHtQ5I+KG/qeAByPeRyDEfDgL+rT9o/h5fJJV qxl3BjLrmd1Rpw== X-Received: by 10.28.199.207 with SMTP id x198mr8635263wmf.156.1502437627996; Fri, 11 Aug 2017 00:47:07 -0700 (PDT) Received: from odin (odin.sdf-eu.org. [178.63.35.194]) by smtp.gmail.com with ESMTPSA id 123sm694885wmt.14.2017.08.11.00.47.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 11 Aug 2017 00:47:07 -0700 (PDT) Date: Fri, 11 Aug 2017 07:46:54 +0000 From: Adam Thompson To: Karl Dahlke Cc: Edbrowse-dev@lists.the-brannons.com Message-ID: <20170811074654.GB15710@odin> References: <20170622224940.eklhad@comcast.net> <20170728195103.GE20415@odin> <20170628180519.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20170628180519.eklhad@comcast.net> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [Edbrowse-dev] JS1 X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.24 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Aug 2017 07:46:21 -0000 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 w= e can > > keep spinning round the main input loop even if js is stuck in some exp= ensive > > operation. >=20 > In theory we could, but today we don't. > I send a message over pipe to js process and block read waiting for a res= ponse. > 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 wi= ld. > 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 free= dom 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 a= n 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 ag= ain. This appears to work in testing since what happens is that we run one of th= e 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 re= ad it then spin back round and catch the fact that we have timers pending. I'm n= ot 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.