Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I have hardly ever known a mathematician who was capable of reasoning. -- Plato


devel / comp.lang.python / Re: tail

SubjectAuthor
* Re: tailBarry Scott
`* Re: tailStefan Ram
 +- Re: tail2QdxY4RzWzUUiLuE
 `- Re: tailBarry

1
Re: tail

<mailman.352.1652034715.20749.python-list@python.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=18192&group=comp.lang.python#18192

 copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: bar...@barrys-emacs.org (Barry Scott)
Newsgroups: comp.lang.python
Subject: Re: tail
Date: Sun, 8 May 2022 19:31:45 +0100
Lines: 166
Message-ID: <mailman.352.1652034715.20749.python-list@python.org>
References: <CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com>
<A3773CDA-B6FE-4A51-8D75-362397220F67@barrys-emacs.org>
<CABbU2U_J7HdUjDV8TLjHJkUb7xBTUes6rG0F17sDJNFX13-SNg@mail.gmail.com>
<3848780F-83B8-4B5F-BFAD-157390288C15@barrys-emacs.org>
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.80.82.1.1\))
Content-Type: text/plain;
charset=us-ascii
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de raD4cHBwVXHLIWG6y08iPALO+Pm3a/uSWqscbcLNIklg==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'def': 0.04; 'knows': 0.04;
'bigger': 0.05; 'chances': 0.05; 'parameter': 0.05; 'anyway,':
0.09; 'byte': 0.09; 'cc:addr:python-list': 0.09; 'elif': 0.09;
'else:': 0.09; 'from:addr:barry': 0.09; 'linux': 0.09;
'received:217.70': 0.09; 'received:gandi.net': 0.09;
'received:mail.gandi.net': 0.09; 'smaller': 0.09; 'string,': 0.09;
'text.': 0.09; 'typically': 0.09; 'import': 0.15; 'url:mailman':
0.15; 'problem.': 0.15; '"\\n"': 0.16; '-1:': 0.16; '2022,': 0.16;
'barry': 0.16; 'behaviour': 0.16; 'builtin': 0.16; 'cc:name:python
list': 0.16; 'char': 0.16; 'encoding': 0.16; 'found.': 0.16;
'from:addr:barrys-emacs.org': 0.16; 'from:name:barry scott': 0.16;
'furthermore,': 0.16; 'message-id:@barrys-emacs.org': 0.16;
'newline': 0.16; 'none:': 0.16; 'shortly,': 0.16; 'simpler,':
0.16; 'specified,': 0.16; 'wrote:': 0.16; 'api': 0.17;
'cc:addr:python.org': 0.20; "i've": 0.22; 'way.': 0.22; 'code':
0.23; 'lines': 0.23; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'url:listinfo': 0.25; 'cannot': 0.25;
'cc:2**0': 0.25; 'url-ip:188.166/16': 0.25; 'seems': 0.26;
'binary': 0.26; 'object': 0.26; 'else': 0.27; 'function': 0.27;
'url-ip:188/8': 0.31; 'think': 0.32; 'empty': 0.32; 'split': 0.32;
'but': 0.32; 'there': 0.33; '100': 0.33; 'header:In-Reply-To:1':
0.34; 'final': 0.35; "it's": 0.37; 'file': 0.38; 'could': 0.38;
'read': 0.38; 'two': 0.39; 'quite': 0.39; 'text': 0.39;
'otherwise': 0.39; 'use': 0.39; 'break': 0.39; 'case.': 0.40;
'should': 0.40; 'method': 0.61; 'skip:o 10': 0.61; "there's":
0.61; 'mode': 0.62; 'skip:o 20': 0.63; 'true': 0.63; 'between':
0.63; 'finished': 0.64; 'your': 0.64; 'skip:t 20': 0.66;
'received:217': 0.67; 'skip:e 20': 0.67; 'per': 0.68; 'clear.':
0.69; 'mix': 0.69; 'too.': 0.70; 'little': 0.73; 'near': 0.76;
'seek': 0.81; 'eventually': 0.84; 'junction': 0.84;
'misalignment': 0.84; 'points.': 0.84; 'sulla': 0.84; 'tiny':
0.84; 'mode.': 0.89; 'meets': 0.91; 'tend': 0.91; 'trick': 0.91
In-Reply-To: <CABbU2U_J7HdUjDV8TLjHJkUb7xBTUes6rG0F17sDJNFX13-SNg@mail.gmail.com>
X-Mailer: Apple Mail (2.3696.80.82.1.1)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <3848780F-83B8-4B5F-BFAD-157390288C15@barrys-emacs.org>
X-Mailman-Original-References: <CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com>
<A3773CDA-B6FE-4A51-8D75-362397220F67@barrys-emacs.org>
<CABbU2U_J7HdUjDV8TLjHJkUb7xBTUes6rG0F17sDJNFX13-SNg@mail.gmail.com>
 by: Barry Scott - Sun, 8 May 2022 18:31 UTC

> On 8 May 2022, at 17:05, Marco Sulla <Marco.Sulla.Python@gmail.com> wrote:
>
> I think I've _almost_ found a simpler, general way:
>
> import os
>
> _lf = "\n"
> _cr = "\r"
>
> def tail(filepath, n=10, newline=None, encoding=None, chunk_size=100):
> n_chunk_size = n * chunk_size

Why use tiny chunks? You can read 4KiB as fast as 100 bytes as its typically the smaller size the file system will allocate.
I tend to read on multiple of MiB as its near instant.

> pos = os.stat(filepath).st_size

You cannot mix POSIX API with text mode.
pos is in bytes from the start of the file.
Textmode will be in code points. bytes != code points.

> chunk_line_pos = -1
> lines_not_found = n
>
> with open(filepath, newline=newline, encoding=encoding) as f:
> text = ""
>
> hard_mode = False
>
> if newline == None:
> newline = _lf
> elif newline == "":
> hard_mode = True
>
> if hard_mode:
> while pos != 0:
> pos -= n_chunk_size
>
> if pos < 0:
> pos = 0
>
> f.seek(pos)

In text mode you can only seek to a value return from f.tell() otherwise the behaviour is undefined.

> text = f.read()

You have on limit on the amount of data read.

> lf_after = False
>
> for i, char in enumerate(reversed(text)):

Simple use text.rindex('\n') or text.rfind('\n') for speed.

> if char == _lf:
> lf_after == True
> elif char == _cr:
> lines_not_found -= 1
>
> newline_size = 2 if lf_after else 1
>
> lf_after = False
> elif lf_after:
> lines_not_found -= 1
> newline_size = 1
> lf_after = False
>
>
> if lines_not_found == 0:
> chunk_line_pos = len(text) - 1 - i + newline_size
> break
>
> if lines_not_found == 0:
> break
> else:
> while pos != 0:
> pos -= n_chunk_size
>
> if pos < 0:
> pos = 0
>
> f.seek(pos)
> text = f.read()
>
> for i, char in enumerate(reversed(text)):
> if char == newline:
> lines_not_found -= 1
>
> if lines_not_found == 0:
> chunk_line_pos = len(text) - 1 - i +
> len(newline)
> break
>
> if lines_not_found == 0:
> break
>
>
> if chunk_line_pos == -1:
> chunk_line_pos = 0
>
> return text[chunk_line_pos:]
>
>
> Shortly, the file is always opened in text mode. File is read at the end in
> bigger and bigger chunks, until the file is finished or all the lines are
> found.

It will fail if the contents is not ASCII.

>
> Why? Because in encodings that have more than 1 byte per character, reading
> a chunk of n bytes, then reading the previous chunk, can eventually split
> the character between the chunks in two distinct bytes.

No it cannot. text mode only knows how to return code points. Now if you are in
binary it could be split, but you are not in binary mode so it cannot.

> I think one can read chunk by chunk and test the chunk junction problem. I
> suppose the code will be faster this way. Anyway, it seems that this trick
> is quite fast anyway and it's a lot simpler.

> The final result is read from the chunk, and not from the file, so there's
> no problems of misalignment of bytes and text. Furthermore, the builtin
> encoding parameter is used, so this should work with all the encodings
> (untested).
>
> Furthermore, a newline parameter can be specified, as in open(). If it's
> equal to the empty string, the things are a little more complicated, anyway
> I suppose the code is clear. It's untested too. I only tested with an utf8
> linux file.
>
> Do you think there are chances to get this function as a method of the file
> object in CPython? The method for a file object opened in bytes mode is
> simpler, since there's no encoding and newline is only \n in that case.

State your requirements. Then see if your implementation meets them.

Barry

> --
> https://mail.python.org/mailman/listinfo/python-list
>

Re: tail

<reading-20220508195126@ram.dialup.fu-berlin.de>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=18194&group=comp.lang.python#18194

 copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: tail
Date: 8 May 2022 18:52:42 GMT
Organization: Stefan Ram
Lines: 34
Expires: 1 Apr 2023 11:59:58 GMT
Message-ID: <reading-20220508195126@ram.dialup.fu-berlin.de>
References: <CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com> <A3773CDA-B6FE-4A51-8D75-362397220F67@barrys-emacs.org> <CABbU2U_J7HdUjDV8TLjHJkUb7xBTUes6rG0F17sDJNFX13-SNg@mail.gmail.com> <3848780F-83B8-4B5F-BFAD-157390288C15@barrys-emacs.org> <mailman.352.1652034715.20749.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de g4kYBh2hh8+Cc+qMDDnqcwuDO0ZR7etMak6iJaTkD+o3zc
X-Copyright: (C) Copyright 2022 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Sun, 8 May 2022 18:52 UTC

Barry Scott <barry@barrys-emacs.org> writes:
>Why use tiny chunks? You can read 4KiB as fast as 100 bytes

When optimizing code, it helps to be aware of the orders of
magnitude. Code that is more cache-friendly is faster, that is,
code that holds data in single region of memory and that uses
regular patterns of access. Chandler Carruth talked about this,
and I made some notes when watching the video of his talk:

CPUS HAVE A HIERARCHICAL CACHE SYSTEM
(from a 2014 talk by Chandler Carruth)

One cycle on a 3 GHz processor 1 ns
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20xL2, 200xL1
Compress 1K bytes with Snappy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD 150,000 ns 0.15 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
Read 1 MB sequentially From SSD 1,000,000 ns 1 ms 4x memory
Disk seek 10,000,000 ns 10 ms 20xdatacen. RT
Read 1 MB sequentially from disk 20,000,000 ns 20 ms 80xmem.,20xSSD
Send packet CA->Netherlands->CA 150,000,000 ns 150 ms

. Remember how recently people here talked about how you cannot
copy text from a video? Then, how did I do it? Turns out, for my
operating system, there's a screen OCR program! So I did this OCR
and then manually corrected a few wrong characters, and was done!

Re: tail

<mailman.362.1652118787.20749.python-list@python.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=18208&group=comp.lang.python#18208

 copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: 2QdxY4Rz...@potatochowder.com
Newsgroups: comp.lang.python
Subject: Re: tail
Date: Mon, 9 May 2022 12:52:57 -0500
Lines: 11
Message-ID: <mailman.362.1652118787.20749.python-list@python.org>
References: <CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com>
<A3773CDA-B6FE-4A51-8D75-362397220F67@barrys-emacs.org>
<CABbU2U_J7HdUjDV8TLjHJkUb7xBTUes6rG0F17sDJNFX13-SNg@mail.gmail.com>
<3848780F-83B8-4B5F-BFAD-157390288C15@barrys-emacs.org>
<mailman.352.1652034715.20749.python-list@python.org>
<reading-20220508195126@ram.dialup.fu-berlin.de>
<YnlU+dZE0J6L6Zp9@scrozzle>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.uni-berlin.de U0o9t0uxGtAOQac3I0XAxA8KrLGfaVtBWOqnXkhTtOLw==
Return-Path: <2QdxY4RzWzUUiLuE@potatochowder.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.014
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'ram': 0.07; 'characters,':
0.09; 'received:78': 0.09; 'video,': 0.09; 'corrected': 0.16;
'from:addr:2qdxy4rzwzuuilue': 0.16; 'from:addr:potatochowder.com':
0.16; 'message-id:@scrozzle': 0.16; 'program!': 0.16;
'received:136.243': 0.16; 'received:78.46': 0.16; 'received:www458
.your-server.de': 0.16; 'received:your-server.de': 0.16; 'turns':
0.16; 'wrote:': 0.16; 'probably': 0.17; 'it?': 0.19; 'to:addr
:python-list': 0.20; "what's": 0.22; 'received:de': 0.23;
'cannot': 0.25; 'tried': 0.26; 'stefan': 0.26; 'wrong': 0.28;
'recently': 0.29; 'learning,': 0.31; "doesn't": 0.32;
'received:136': 0.32; 'header:In-Reply-To:1': 0.34; 'system,':
0.36; 'people': 0.36; 'text': 0.39; 'remember': 0.61; "there's":
0.61; 'here': 0.62; 'copy': 0.63; 'let': 0.66; 'worked': 0.67;
'manually': 0.69; 'out,': 0.78; 'received:70': 0.84; 'talked':
0.84; 'video?': 0.84
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <reading-20220508195126@ram.dialup.fu-berlin.de>
X-Authenticated-Sender: 2QdxY4RzWzUUiLuE@potatochowder.com
X-Virus-Scanned: Clear (ClamAV 0.103.5/26536/Mon May 9 10:04:57 2022)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <YnlU+dZE0J6L6Zp9@scrozzle>
X-Mailman-Original-References: <CABbU2U99Jpa6nuYg0sXw6=GjBEKVk9u-_oyxSoL8hLrW_2FoBA@mail.gmail.com>
<A3773CDA-B6FE-4A51-8D75-362397220F67@barrys-emacs.org>
<CABbU2U_J7HdUjDV8TLjHJkUb7xBTUes6rG0F17sDJNFX13-SNg@mail.gmail.com>
<3848780F-83B8-4B5F-BFAD-157390288C15@barrys-emacs.org>
<mailman.352.1652034715.20749.python-list@python.org>
<reading-20220508195126@ram.dialup.fu-berlin.de>
 by: 2QdxY4Rz...@potatochowder.com - Mon, 9 May 2022 17:52 UTC

On 2022-05-08 at 18:52:42 +0000,
Stefan Ram <ram@zedat.fu-berlin.de> wrote:

> Remember how recently people here talked about how you cannot copy
> text from a video? Then, how did I do it? Turns out, for my
> operating system, there's a screen OCR program! So I did this OCR
> and then manually corrected a few wrong characters, and was done!

When you're learning, and the example you tried doesn't work like it
worked on the video, you probably don't know what's wrong, let alone how
to correct it.

Re: tail

<mailman.365.1652129935.20749.python-list@python.org>

 copy mid

https://www.novabbs.com/devel/article-flat.php?id=18212&group=comp.lang.python#18212

 copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: bar...@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: tail
Date: Mon, 9 May 2022 21:58:45 +0100
Lines: 55
Message-ID: <mailman.365.1652129935.20749.python-list@python.org>
References: <reading-20220508195126@ram.dialup.fu-berlin.de>
<D8A15E42-FE38-475E-B8C0-97E3EEAD8110@barrys-emacs.org>
Mime-Version: 1.0 (1.0)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de MJ6sTaS8HlXZI10ZNBsAGwB/IZoJ/f2v+FfGl8gA0/7A==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: Python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.031
X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'byte': 0.09; 'cc:addr
:python-list': 0.09; 'characters,': 0.09; 'from:addr:barry': 0.09;
'processor': 0.09; 'received:217.70': 0.09; 'received:gandi.net':
0.09; 'received:mail.gandi.net': 0.09; 'writes:': 0.09; 'cc:no
real name:2**0': 0.14; 'url:mailman': 0.15; 'memory': 0.15;
'1,000,000': 0.16; '2022,': 0.16; 'barry': 0.16; 'corrected':
0.16; 'faster,': 0.16; 'from:addr:barrys-emacs.org': 0.16;
'message-id:@barrys-emacs.org': 0.16; 'patterns': 0.16;
'program!': 0.16; 'sequentially': 0.16; 'to:addr:ram': 0.16;
'to:addr:zedat.fu-berlin.de': 0.16; 'turns': 0.16; 'wrote:': 0.16;
'python': 0.16; 'uses': 0.19; 'it?': 0.19; 'round': 0.19;
'cc:addr:python.org': 0.20; 'code': 0.23; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'cannot': 0.25; 'cc:2**0': 0.25; 'url-
ip:188.166/16': 0.25; 'notes': 0.26; 'wrong': 0.28; 'recently':
0.29; 'code,': 0.31; 'url-ip:188/8': 0.31; '100': 0.33; 'same':
0.34; 'header:In-Reply-To:1': 0.34; 'system,': 0.36; 'people':
0.36; 'main': 0.37; 'read': 0.38; 'least': 0.39; 'single': 0.39;
'text': 0.39; 'this,': 0.39; 'branch': 0.39; 'use': 0.39; 'helps':
0.60; 'reference': 0.60; 'remember': 0.61; "there's": 0.61;
'here': 0.62; 'true': 0.63; 'send': 0.63; 'copy': 0.63;
'watching': 0.64; 'his': 0.65; 'received:217': 0.67; 'video':
0.68; 'manually': 0.69; 'scale': 0.69; 'within': 0.69;
'we\xe2\x80\x99ll': 0.76; 'out,': 0.78; 'seek': 0.81; '3,000':
0.84; '500,000': 0.84; 'cycle': 0.84; 'optimizing': 0.84;
'orders': 0.84; 'scott': 0.84; 'talked': 0.84; 'tiny': 0.84;
'video?': 0.84; 'expensive': 0.91; 'holds': 0.91
In-Reply-To: <reading-20220508195126@ram.dialup.fu-berlin.de>
X-Mailer: iPad Mail (19E258)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <D8A15E42-FE38-475E-B8C0-97E3EEAD8110@barrys-emacs.org>
X-Mailman-Original-References: <reading-20220508195126@ram.dialup.fu-berlin.de>
 by: Barry - Mon, 9 May 2022 20:58 UTC

> On 9 May 2022, at 17:41, ram@zedat.fu-berlin.de wrote:
>
> Barry Scott <barry@barrys-emacs.org> writes:
>> Why use tiny chunks? You can read 4KiB as fast as 100 bytes
>
> When optimizing code, it helps to be aware of the orders of
> magnitude

That is true and we’ll know to me, now show how what I said is wrong..

The os is going to DMA at least 4k, with read ahead more like 64k.
So I can get that into the python memory at the same scale of time as
1 byte because it’s the setup of the I/O that is expensive not the bytes
transferred.

Barry

> . Code that is more cache-friendly is faster, that is,
> code that holds data in single region of memory and that uses
> regular patterns of access. Chandler Carruth talked about this,
> and I made some notes when watching the video of his talk:
>
> CPUS HAVE A HIERARCHICAL CACHE SYSTEM
> (from a 2014 talk by Chandler Carruth)
>
> One cycle on a 3 GHz processor 1 ns
> L1 cache reference 0.5 ns
> Branch mispredict 5 ns
> L2 cache reference 7 ns 14x L1 cache
> Mutex lock/unlock 25 ns
> Main memory reference 100 ns 20xL2, 200xL1
> Compress 1K bytes with Snappy 3,000 ns
> Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
> Read 4K randomly from SSD 150,000 ns 0.15 ms
> Read 1 MB sequentially from memory 250,000 ns 0.25 ms
> Round trip within same datacenter 500,000 ns 0.5 ms
> Read 1 MB sequentially From SSD 1,000,000 ns 1 ms 4x memory
> Disk seek 10,000,000 ns 10 ms 20xdatacen. RT
> Read 1 MB sequentially from disk 20,000,000 ns 20 ms 80xmem.,20xSSD
> Send packet CA->Netherlands->CA 150,000,000 ns 150 ms
>
> . Remember how recently people here talked about how you cannot
> copy text from a video? Then, how did I do it? Turns out, for my
> operating system, there's a screen OCR program! So I did this OCR
> and then manually corrected a few wrong characters, and was done!
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
>

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor