this post was submitted on 21 Nov 2023
20 points (100.0% liked)

Python

6413 readers
4 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 1 year ago
MODERATORS
top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 5 points 1 year ago* (last edited 1 year ago)

Since it's running mypyc (https://mypyc.readthedocs.io/en/latest/index.html ) on the imports under the hood, I'm struggling to see why you'd want to limit yourself to the standard library instead of just compiling your whole program as a module with mypyc directly?

At the same time, if the gains are consistent, I also feel that CPython should just compile an entire standard library on installation.

EDIT: benchmarks for mypyc look impressive, only exceptions are slower:

[–] [email protected] 3 points 1 year ago (1 children)

Hmmm. Interesting. Why not a project that just simply writes the (Python parts of the) standard library in C directly?

[–] [email protected] 4 points 1 year ago (1 children)

Many, many parts of the standard library are written in C. Most performance critical parts are.

Do you need a pre-compiled tomllib? If you are using toml a lot, maybe. But chances are that you aren't reading a lot of toml files, and if you are, then you're probably already using rtoml.

[–] [email protected] 3 points 1 year ago

The json is also still Python code. ujson helps but still json.dumps is suuuper slow.