Hacker News new | past | comments | ask | show | jobs | submit login

> Each example just calls out to a very fast c library…

No.

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




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

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


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)…".


  from re import sub, findall
That's where pcre2 is called (or a finely tuned regex c lib)




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?




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: