Re:How Many Lines of C It Takes to Execute a and B in Python?
by anitil on Monday December 11, 2023 @09:34PM
(#38608600)
I'd love to see an example of this if you happen to have one available. I hit a startup-time issue in a previous life, and I wish I had spent the time looking at it back then
Re:How Many Lines of C It Takes to Execute a and B in Python?
by explaininjs on Tuesday December 12, 2023 @02:28AM
(#38610677)
A template repo can be found here https://github.com/JacksonKearl/cpython, but it does not implement an ideal malloc, just a baseline one - I am not sure if it is still being used as an assignment.
The repo states that even this dummy implementation:
> has a 60% faster startup as compared to base CPython, and in some test cases has marginally better runtime performance as well.
This is most effective for reducing startup time of short lived scripts, where the runtime is dominated by many thousands of trivial mallocs right at startup. But in general if you can establish a bound on memory, it will be faster to allocate it in one shot.