Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

We are drowning in information but starved for knowledge. -- John Naisbitt, Megatrends


devel / comp.lang.python / Re: tail

SubjectAuthor
o Re: tailMarco Sulla

1
Re: tail

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: Marco.Su...@gmail.com (Marco Sulla)
Newsgroups: comp.lang.python
Subject: Re: tail
Date: Sun, 8 May 2022 22:36:06 +0200
Lines: 29
Message-ID: <mailman.356.1652042205.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>
<CABbU2U92=Xz3d2jesNZi83stnGG1XWFg7ig-=tjE5_4b_XSyzQ@mail.gmail.com>
<CAPTjJmoGC=j8dKZtgkz6O3LP+esKFMyp+hpDypPiA4jdY-rOyg@mail.gmail.com>
<CABbU2U8mm9e-bdC7DJTGLphjLS3D9g2nkD-k1g-TnBPEUXDyCA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de AHaX5r9gov8w3kHfT04fmgF6lFMR4z2nKG7sxwta1x3w==
Return-Path: <elbarbun@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=N129WxTn;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.049
X-Spam-Evidence: '*H*': 0.90; '*S*': 0.00; '2022': 0.05; 'sun,': 0.07;
'angelico': 0.09; 'cc:addr:python-list': 0.09;
'received:209.85.219': 0.09; 'that.': 0.15; 'cc:name:python list':
0.16; 'cpython': 0.16; 'from:name:marco sulla': 0.16; 'gain,':
0.16; 'imho,': 0.16; 'opinion,': 0.16; 'reality.': 0.16; 'wrote:':
0.16; "can't": 0.17; 'cc:addr:python.org': 0.20; 'code': 0.23;
'anything': 0.25; 'depends': 0.25; 'cc:2**0': 0.25; 'seems': 0.26;
'task': 0.26; 'chris': 0.28; 'fact': 0.28; 'sense': 0.28; 'whole':
0.30; 'approach': 0.31; 'think': 0.32; 'language.': 0.32;
'rejected.': 0.32; 'message-id:@mail.gmail.com': 0.32; 'but':
0.32; 'core': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'complex': 0.35; 'respect': 0.35;
'from:addr:gmail.com': 0.35; 'files': 0.36; "it's": 0.37;
'received:209.85': 0.37; 'file': 0.38; 'way': 0.38;
'received:209': 0.39; 'quite': 0.39; 'use': 0.39; 'case.': 0.40;
'seeking': 0.40; 'stated': 0.60; 'method': 0.61; 'skip:o 10':
0.61; "there's": 0.61; 'pass': 0.64; 'your': 0.64; 'exactly':
0.68; 'files:': 0.69; 'times': 0.69; 'suite': 0.71; 'little':
0.73; 'absolutely': 0.84; 'choices': 0.84; 'very,': 0.84;
'doing.': 0.91; 'optimization': 0.93
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
:cc; bh=BuBlwwtjSGSyzeHH2JfeGpfRjvkwODC8rRlpyF7vmWg=;
b=N129WxTnuZLNhpG95XdGEASZf1t04g9upMGbXTLjpQCfi+0t1/RPJlvLZ+mXaMCSLg
2Wm1vo+u9k9zLoHUx8jJYj/tDSXXRRCSUB5Aczh6yatlsN6dZy+Aw3MLc6JeQMwIQtNV
9W6Vgwz3x88XKuF/bc1vRtbpbHGdst0vJqozh6cPNAxy8CeNM9iVqAcgvt23djfoiR80
p4nuh9X5AR4FWhH1FsiI2CqEp8cyvyp4gBGOTYTGTk0iQFF45X49BJxR/JlXG6sT+5zT
YTvlZcckVe5L7r+09SJeohrwRKkidFtd+ouMl0lQemeW6BhY+SOKNirgohuok3P5DlXV
SdLg==
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:cc;
bh=BuBlwwtjSGSyzeHH2JfeGpfRjvkwODC8rRlpyF7vmWg=;
b=TBMts4SZeg4fdnNKkDtz6P072gkJmM7AM5aTiZF5aMcqowtCtgfmDdAeXWwrCl0hT3
GKn/L4g+g87qpDEtqSVS68QC3BcM09RzRO/t9C97MCQnLkYMbOIvFYlATGxG+wXJIHme
XlkDSm6am/QYua2Iqet8vkZaiN83/Oc1/+BOUMczs8+9EltoCK4NKRUvZlCHkzoAEJ7X
mNi+XujNrK0tDfgVFoBtmWXazuxP36cY8/SayKFN4s20+wIg+fPq78zZ46vJT0QpkbY2
92Zoe9HVqzSu9XEVhdFBTi7O2T2k7TSRipCUId3WWZ+dkyLwDAYkul2QyfCChbYr26T5
9Bpw==
X-Gm-Message-State: AOAM532199e7QLknvLR7DWf8Ld8Ksk2rSNokBUcfNc9nFGz0McvCfo4b
wHLf3/SjkmUMgXaHvc+XglFy5kKQrjukrxh3GOQ=
X-Google-Smtp-Source: ABdhPJzwi2pnfUdvkO9yXWjY3MPsdFUhxFoEA+AIFyQvrzXPS4N+8iXRAwtYfHrrJbQGEbuY7NQryzIJoozTkzzP/vs=
X-Received: by 2002:a25:2e07:0:b0:648:4b15:d47d with SMTP id
u7-20020a252e07000000b006484b15d47dmr10319774ybu.287.1652042202970; Sun, 08
May 2022 13:36:42 -0700 (PDT)
In-Reply-To: <CAPTjJmoGC=j8dKZtgkz6O3LP+esKFMyp+hpDypPiA4jdY-rOyg@mail.gmail.com>
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: <CABbU2U8mm9e-bdC7DJTGLphjLS3D9g2nkD-k1g-TnBPEUXDyCA@mail.gmail.com>
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>
<CABbU2U92=Xz3d2jesNZi83stnGG1XWFg7ig-=tjE5_4b_XSyzQ@mail.gmail.com>
<CAPTjJmoGC=j8dKZtgkz6O3LP+esKFMyp+hpDypPiA4jdY-rOyg@mail.gmail.com>
 by: Marco Sulla - Sun, 8 May 2022 20:36 UTC

On Sun, 8 May 2022 at 22:02, Chris Angelico <rosuav@gmail.com> wrote:
>
> Absolutely not. As has been stated multiple times in this thread, a
> fully general approach is extremely complicated, horrifically
> unreliable, and hopelessly inefficient.

Well, my implementation is quite general now. It's not complicated and
inefficient. About reliability, I can't say anything without a test
case.

> The ONLY way to make this sort
> of thing any good whatsoever is to know your own use-case and code to
> exactly that. Given the size of files you're working with, for
> instance, a simple approach of just reading the whole file would make
> far more sense than the complex seeking you're doing. For reading a
> multi-gigabyte file, the choices will be different.

Apart from the fact that it's very, very simple to optimize for small
files: this is, IMHO, a premature optimization. The code is quite fast
even if the file is small. Can it be faster? Of course, but it depends
on the use case. Every optimization in CPython must pass the benchmark
suite test. If there's little or no gain, the optimization is usually
rejected.

> No, this does NOT belong in the core language.

I respect your opinion, but IMHO you think that the task is more
complicated than the reality. It seems to me that the method can be
quite simple and fast.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor