News for hackers. Stuff that matters.
Re:Faster Python with Guido van Rossum by CraigJPerry on Thursday October 07, 2021 @01:20PM (#28789403)
I suspect that site is some kind of in-joke. E.g. read the regex-redux example in say c#, now look at the go version, now the python version…

It’s not really what you’d expect for a site called computer language benchmarks game. Each example just calls out to a very fast c library (pcre2) to perform the heavy lifting regardless of which language is being “benchmarked”.

Seems a pretty pointless site.

The other examples have similar nonsense.

Re:Faster Python with Guido van Rossum by Zababa on Thursday October 07, 2021 @02:43PM (#28790502)
On this page: https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

> "... a pretty solid study on the boredom of performance-oriented software engineers grouped by programming language."

I think that's probably the best way to describe it.

Re:Faster Python with Guido van Rossum by igouy on Thursday October 07, 2021 @02:51PM (#28790587)
Do you mean Python program[mer]s are less bored ?
Re:Faster Python with Guido van Rossum by Zababa on Thursday October 07, 2021 @02:54PM (#28790627)
Oh no, the programs aren't bored at all, they are very busy, which is the problem.

Edit to answer yours: There may be less Python programmers that are bored, or less performance-oriented Python programmers.

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?