Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

6 May, 2024: The networking issue during the past two days has been identified and appears to be fixed. Will keep monitoring.


devel / comp.lang.python / Re: Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

SubjectAuthor
o Re: Ref-strings in logging messages (was: Performance issue withBarry

1
Re: Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

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

  copy mid

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

  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: Ref-strings in logging messages (was: Performance issue with
CPython 3.10 + Cython)
Date: Fri, 7 Oct 2022 18:28:06 +0100
Lines: 28
Message-ID: <mailman.533.1665163695.20444.python-list@python.org>
References: <f583eefa-ef36-a59b-7b33-928d67e49f06@mrabarnett.plus.com>
<FC32E4B4-6B96-44BC-ACE6-C0EF2E93242B@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 oDffiON8ZQpuNQ2xWDRFPQzW4v+JDgvnm4a4sE+OHdJA==
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; '2022': 0.05; 'cc:addr
:python-list': 0.09; 'enabled': 0.09; 'from:addr:barry': 0.09;
'lazy': 0.09; 'received:217.70': 0.09; 'received:gandi.net': 0.09;
'received:mail.gandi.net': 0.09; 'skip:` 20': 0.09; 'log': 0.12;
'cc:no real name:2**0': 0.14; 'url:mailman': 0.15; '2022,': 0.16;
'arguments': 0.16; 'barry': 0.16; 'efficiently': 0.16;
'evaluating': 0.16; 'from:addr:barrys-emacs.org': 0.16; 'message-
id:@barrys-emacs.org': 0.16; 'montanaro': 0.16; 'subject:3.10':
0.16; 'subject:CPython': 0.16; 'subject:Cython': 0.16;
'subject:issue': 0.16; 'subject:logging': 0.16; 'wrote:': 0.16;
'calls': 0.19; 'cc:addr:python.org': 0.20; 'fri,': 0.22; 'url-
ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'discussion': 0.25; 'url:listinfo': 0.25; 'cc:2**0': 0.25; 'url-
ip:188.166/16': 0.25; '>>>': 0.28; 'am,': 0.31; 'module': 0.31;
'url-ip:188/8': 0.31; "i'm": 0.33; 'there': 0.33; 'header:In-
Reply-To:1': 0.34; 'way': 0.38; 'could': 0.38; 'use': 0.39;
'case.': 0.40; 'gone': 0.40; 'me.': 0.62; 'pass': 0.64;
'received:217': 0.67; 'obvious': 0.69; 'admit': 0.84;
'generation.': 0.84; 'subject:Performance': 0.84; 'expensive':
0.91
In-Reply-To: <f583eefa-ef36-a59b-7b33-928d67e49f06@mrabarnett.plus.com>
X-Mailer: iPad Mail (19H12)
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: <FC32E4B4-6B96-44BC-ACE6-C0EF2E93242B@barrys-emacs.org>
X-Mailman-Original-References: <f583eefa-ef36-a59b-7b33-928d67e49f06@mrabarnett.plus.com>
 by: Barry - Fri, 7 Oct 2022 17:28 UTC

> On 7 Oct 2022, at 18:16, MRAB <python@mrabarnett.plus.com> wrote:
>
> On 2022-10-07 16:45, Skip Montanaro wrote:
>>> On Fri, Oct 7, 2022 at 9:42 AM Andreas Ames <andreas.0815.qwertz@gmail.com>
>>> wrote:
>>> 1. The culprit was me. As lazy as I am, I have used f-strings all over the
>>> place in calls to `logging.logger.debug()` and friends, evaluating all
>>> arguments regardless of whether the logger was enabled or not.
>>>
>> I thought there was some discussion about whether and how to efficiently
>> admit f-strings to the logging package. I'm guessing that's not gone
>> anywhere (yet).
> Letting you pass in a callable to call might help because that you could use lambda.

Yep, that’s the obvious way to avoid expensive log data generation.
Would need logging module to support that use case.

Barry

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

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor