News for hackers. Stuff that matters.
Re:Faster Python with Guido van Rossum by igouy on Thursday October 07, 2021 @02:01PM (#28789956)
> Each example just calls out to a very fast c library…

No.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Re:Faster Python with Guido van Rossum by CraigJPerry on Thursday October 07, 2021 @06:36PM (#28792990)
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Your python 3 one isnt the fastest python 3 solution, it’s this one which uses pcre2

Re:Faster Python with Guido van Rossum by igouy on Friday October 08, 2021 @12:00PM (#28800727)
That's correct, the Python program that uses pcre2 is faster.

The slower program is an example from that website of a regex program which does not " just calls out to a very fast c library (pcre2)…".

Re:Faster Python with Guido van Rossum by makapuf on Thursday October 07, 2021 @04:41PM (#28791765)

  from re import sub, findall
That's where pcre2 is called (or a finely tuned regex c lib)
Re:Faster Python with Guido van Rossum by igouy on Thursday October 07, 2021 @06:02PM (#28792656)
Re:Faster Python with Guido van Rossum by makapuf on Friday October 08, 2021 @01:24AM (#28796015)
Re:Faster Python with Guido van Rossum by igouy on Friday October 08, 2021 @11:33AM (#28800401)
And? CPython is implemented in C.

Here's some of a comment from _operator.c

"This module exports a set of functions implemented in C corresponding\n\ to the intrinsic operators of Python. For example, operator.add(x, y)\n\ is equivalent to the expression x+y."

Why wouldn't you expect that CPython regex would "ultimately" be written in C?