|
|
Subscribe / Log in / New account

Speeding up CPython

Speeding up CPython

Posted Dec 17, 2020 9:44 UTC (Thu) by Cyberax (✭ supporter ✭, #52523)
In reply to: Speeding up CPython by quietbritishjim
Parent article: Speeding up CPython

The problem with Python is that you quite often have something like a web-server. It can naturally be ran as multiple processes, so that each interpreter gets its own CPU.

This works fine. But then you want to add an in-memory cache and that's where the problems start. If each process gets its own cache, then you have a massive RAM waste. And that's the only easy option (before you go off into using Redis or memcached with all the associated issues).

It's not really any better for a lot of computational code as well. In my company we have Python code that runs computations for each hour of the year, almost completely independently of each other. It was quite liberating to switch from Python to C++ and get true multi-threading, and a huge performance boost.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds