This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: speeding up a paste operation
- From: Brian Inglis <Brian dot Inglis at SystematicSw dot ab dot ca>
- To: cygwin at cygwin dot com
- Date: Tue, 28 Aug 2018 22:36:49 -0600
- Subject: Re: speeding up a paste operation
- References: <CAD8GWstSbJHnP3XWKvhbtRisB=jJL7SJA9aMOWMJVDbMC_VdYA@mail.gmail.com> <5b80a0d3.1c69fb81.386aa.8658@mx.google.com> <CAD8GWsuPDeQEoBSMDRy36+2G5Ej=LBvsRt0sNVajL3Bs_D0VtA@mail.gmail.com>
- Reply-to: Brian dot Inglis at SystematicSw dot ab dot ca
On 2018-08-24 18:45, Lee wrote:
> On 8/24/18, Steven Penny <svnpenn@gmail.com> wrote:
>> On Fri, 24 Aug 2018 19:30:10, Lee wrote:
>>> In retrospect, I should have created the file some other way, but still..
>>> - grab the top 1M hosts from from
>>> http://s3-us-west-1.amazonaws.com/umbrella-static/index.html
>>> - open w/ libreoffice
>>> - select the host name column, right click & select copy (all 1 million
>>> lines)
>>> - (mintty 2.9.0 window already open) vi /tmp/hosts
>>> - i (get into insert mode)
>>> - right click (which I have set to "paste")
>>>
>>> data is still scrolling by & it's not even up to 100K lines yet :(
>>>
>>> Is there some way to make a paste operation faster in mintty (or vim
>>> or whatever the slowpoke is)?
>>
>> Use the right tool for the job:
>>
>> $ time awk -F, '{print $2}' top-1m.csv > hosts.txt
>> real 0m0.686s
>
> I'd forgotten how slow pasting is in cygwin.. otherwise I'd have just
> deleted column 1, saved as text & dos2unix'ed the file
>
> Oh well... I was hoping I'd set up something wrong in cygwin, but at
> least I remember why not to paste lots o lines in cygwin.
Don't save what you don't need:
$ time curl -LSs
http://s3-us-west-1.amazonaws.com/umbrella-static/top-1m.csv.zip | funzip | awk
-F, '{print $2}' > hosts.txt
real 0m6.396s
user 0m3.046s
sys 0m0.372s
If you need to save intermediate files, insert tee commands.
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple