Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

grep me no patterns and I'll tell you no lines.


devel / comp.lang.python / Re: tail

SubjectAuthor
o Re: tailChris Angelico

1
Re: tail

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: tail
Date: Sun, 24 Apr 2022 10:39:48 +1000
Lines: 20
Message-ID: <mailman.232.1650760800.20749.python-list@python.org>
References: <CAPTjJmo7oNKuuiQPa_t3X9Sws3veDuX4660We5ZKFPeajC9+Ng@mail.gmail.com>
<YmSTwYXFZqpZt3a7@cskk.homeip.net>
<CAPTjJmrbsjCF=vpNmWAdzHSmytE803bzntbHugeMQCJEqNbJOA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de arpIXpcZTmJVKmoIKVo+XAxjjFgeXbgXOpn5q1ev8bVA==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=cD3PZcop;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.001
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '2022': 0.05; 'sun,': 0.07;
'angelico': 0.09; 'byte': 0.09; 'though.': 0.09; 'cameron': 0.16;
'chrisa': 0.16; 'chunking,': 0.16; 'elaborate': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'locate': 0.16; 'received:209.85.221.49': 0.16; 'received:mail-
wr1-f49.google.com': 0.16; 'simpson': 0.16; 'vague': 0.16;
'wrote:': 0.16; 'to:addr:python-list': 0.20; "i'd": 0.24; 'idea':
0.24; 'chris': 0.28; 'expect': 0.28; 'approach': 0.31; 'think':
0.32; 'zero': 0.32; 'message-id:@mail.gmail.com': 0.32; 'but':
0.32; "didn't": 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'received:209.85': 0.37; 'file': 0.38; 'received:209': 0.39;
'single': 0.39; 'use': 0.39; 'true.': 0.40; 'both': 0.40
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=q4FKeTiYzkCqQTLwiW4fmKM28cviz3XCLAjdKlk17A4=;
b=cD3PZcopwhJEJeqRQVUnx7aVsmkofLw5+3Uy0QnpcXb8T+LHNhNYJywzV5gSm0b5Si
SdUd2WiJgrdWlzzsT8KxWbkYSQhf8d6TJ2RI4yzdHPdtm2nvEN77p9euIMGDvya94NSU
mwgbzQwxfMIZI9b2zjedYwcMMBR8FfJBzD8guqUJ7GD/w0SilcVV1TTzP8MaGMKtStIU
hBhtzOxppa5NwdULKQOU7fjPC9ucerVWlh6SqIn5isoK6gf1XBJgLykj7ijNESCPZnEI
HWUH32oofjT4pi8stP2iEAJsF0TuehPG6gpYGj1IV0Y0w16qIYlU8OZT622NOKbrHHQZ
4Yjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=q4FKeTiYzkCqQTLwiW4fmKM28cviz3XCLAjdKlk17A4=;
b=30PFG/+ZOQNM5vaziJM7jryZgu/MBhER+V0QGCpMdPSKvFlQ+vLVN+SLxQX2tiC6pU
1qYC18mGyyEDmnkX/fv2hjwuiw609ywWIKILcBb15A7qHH5I1spiHPAAzZZjBb3izSRQ
Vf0ZEFE3gOLztjx5p9wmgoJcUyOc0GEqJwWt73IsWIK70ZK+wjJyzbOZMsmQbZvyklK0
FMmhOKdzLZHJMGve4yUZRJQlWvxhSpCl5OpqR6QwJAZlPGws4vAvhzGqOzKI6nVXXFcv
6W8C26l5zklYIhV24wefsRU5RU4x0bkCesoaJLjRloicNkZvHFR6N8Jjhoec+2nIYQ2w
lFHg==
X-Gm-Message-State: AOAM5327rp+Yu5KRvYKaLIvpzWv2RmzDOJrffyRbXR3Cp7uRZPC/i/do
JL3eEDT8eLgyqNEi4BfPR5JZ8SdcrwePAGnYUkbso+wH
X-Google-Smtp-Source: ABdhPJxpxff8qjJvqLDUBy4ACpUDFpn+pBw/VA0pF8AKd+rNwvdcQelJHU9XgSEYRAXm4FPmP9CFdhBV/5eh/j9+wJk=
X-Received: by 2002:a5d:64eb:0:b0:20a:8d83:7d31 with SMTP id
g11-20020a5d64eb000000b0020a8d837d31mr8783195wri.160.1650760799647; Sat, 23
Apr 2022 17:39:59 -0700 (PDT)
In-Reply-To: <YmSTwYXFZqpZt3a7@cskk.homeip.net>
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: <CAPTjJmrbsjCF=vpNmWAdzHSmytE803bzntbHugeMQCJEqNbJOA@mail.gmail.com>
X-Mailman-Original-References: <CAPTjJmo7oNKuuiQPa_t3X9Sws3veDuX4660We5ZKFPeajC9+Ng@mail.gmail.com>
<YmSTwYXFZqpZt3a7@cskk.homeip.net>
 by: Chris Angelico - Sun, 24 Apr 2022 00:39 UTC

On Sun, 24 Apr 2022 at 10:04, Cameron Simpson <cs@cskk.id.au> wrote:
>
> On 24Apr2022 08:21, Chris Angelico <rosuav@gmail.com> wrote:
> >On Sun, 24 Apr 2022 at 08:18, Cameron Simpson <cs@cskk.id.au> wrote:
> >> An approach I think you both may have missed: mmap the file and use
> >> mmap.rfind(b'\n') to locate line delimiters.
> >> https://docs.python.org/3/library/mmap.html#mmap.mmap.rfind
> >
> >Yeah, I made a vague allusion to use of mmap, but didn't elaborate
> >because I actually have zero idea of how efficient this would be.
> >Would it be functionally equivalent to the chunking, but with the
> >chunk size defined by the system as whatever's most optimal? It would
> >need to be tested.
>
> True. I'd expect better than single byte seek/read though.
>

Yeah, I think pretty much *anything* would be better than single byte seeks.

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor