[Date Prev][Date Next][Thread Prev][][Date Index][Thread Index]

Re: Another approach to improve w3m-doenload

I worked on the two kinds of approaches to improve w3m-download.
Both feature:

・Fully asynchronous operation
・Allow parallel downloads at a time
・Progress indicator(s) in the mode-line
・Not eat much Emacs' memory, only a header is cached

[1] is a version to use a timer that watches the size of a local
file being downloaded for the progress indicator.  This version
runs w3m twice separately; runs with the -dump_head option to get
the header of the remote contents to know the file size and the
timestamp, and runs with the -dump_source option to download the
contents directly to a local file.  The latter starts the timer.

[2] is a version to divide the output of `w3m -dump_extra' to
two streams using awk; one is for the progress indicator fed to
an Emacs' process buffer and the other is for the contents of a
remote file redirecting directly to a local file.

The both codes are almost complete, however either ones have an
unavoidable issue on the progress indicator.

As for [1] the indicator starts to increase after w3m starts to
write the remote contents to a local file.  It is the time when
w3m has buffered the contents fully in a local memory, not at
w3m starts to download.

Contrary, [2] starts the indicator to increase when w3m starts to
download, and finishes when w3m has buffered the remote contents
fully in a local memory, but time w3m takes thereafter to save
the contents to a local file is not necessarily negligible.  This
is just the current version's behavior except for the slowness of
saving though.  This version is equipped with a trick that blinks
the indicator for a while after the indicator's value gets still.

The one suitable to a slow connection would be [2], and of which
perfection is higher.

Here are two patches according to those two ways respectively.
Both are aimed to apply to the latest git master.

Attachment: patch1.gz
Description: application/gunzip

Attachment: patch2.gz
Description: application/gunzip