unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Asynchronous DNS resolving
@ 2015-02-13  7:10 Lars Ingebrigtsen
  2015-02-13  7:21 ` Paul Eggert
  2015-02-13  8:46 ` Eli Zaretskii
  0 siblings, 2 replies; 12+ messages in thread
From: Lars Ingebrigtsen @ 2015-02-13  7:10 UTC (permalink / raw)
  To: emacs-devel

The major usability problem in eww now seems to be synchronous DNS
resolution.

When you go to a web page, eww will render it, and then insert images
asynchronously.  All the network stuff happens pretty asynchronously --
except for the DNS lookups.  If you're unlucky, a lookup may take
several seconds, and there may be several of these lookups.  Meanwhile,
Emacs is pretty much frozen while waiting for the DNS packets to find
their way back to home base...

This is seriously yucky.

A few years back I looked into making the Emacs domain lookup thing be
asynchronous, but that was way beyond my knowledge of Emacs internals,
and what happens when I fork Emacs, and what Emacs Lisp primitives can
be used in the forked instance.

So perhaps doing what Firefox used to do in the 90s would be a possibly
solution, anyway?  That is, have a teensy multi-threaded executable that
reads commands from STDIN and outputs the replies on STDOUT.  Like
lib-src/dns-helper.c or something.

The command format would be something like

<tag> <command> <data>

I.e.,

45 lookup fsf.org
46 lookup images.fsf.org
...

(Tags for streaming commands and matching up the responses with the
requests, a la IMAP.)

We'd then have something like

(with-domain-name-lookup (ip "fsf.org")
  (message "We got %s and now we're going to connect" ip)
  (with-url ("http://fsf.org" :ip-address ip ...)
    (pop-to-buffer (current-buffer))))

to do a completely asynchronous web request.

Or does anybody have a better idea for solving this problem?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-02-15  5:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13  7:10 Asynchronous DNS resolving Lars Ingebrigtsen
2015-02-13  7:21 ` Paul Eggert
2015-02-13  7:32   ` Lars Ingebrigtsen
2015-02-13  7:58     ` Paul Eggert
2015-02-13 19:20     ` Stefan Monnier
2015-02-14  0:06       ` chad
2015-02-14  3:44       ` Lars Ingebrigtsen
2015-02-14  6:20         ` Paul Eggert
2015-02-15  4:54           ` Lars Ingebrigtsen
2015-02-13  8:46 ` Eli Zaretskii
2015-02-13  9:02   ` Lars Ingebrigtsen
2015-02-15  5:31     ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).