Hacker News new | ask | show | jobs
by zeeg 4742 days ago
PyPy uses too much memory and isnt that much faster for many things.

(Sorry PyPy guys!)

I dont have numbers/charts to pull up for this right now, but I was testing it out to see if I could push more cpu on a server, and the memory cost was insane for the minimal test case.

Twisted also is not a web server, it's a framework. Same with Tornado, and honestly, the same with gevent/etc.

2 comments

How much memory usage is "insane"? Are you sure the memory cost grows with the size of the application? It sounds like you tested a minimal test case, saw high memory usage, then didn't bother to test a large application. Maybe the memory usage is constant.
I saw 5x memory usage, which was already something I was trying to optimize.

There's a ticket I opened on the PyPy tracker, but this is sort of expected if I understand JITs correctly.

I didn't exhaustively benchmark it, but the initial results were too far outside the bounds of my limitations.

5x memory usage of what? You're not giving actual numbers, nor the benchmark you used.
>5x memory usage of what?

Of what he was seeing without PyPy.

He doesn't want advice on how to lower that. He wants to get the same memory usage or better out of the box.

No I wanted reasonable tradeoffs.

e.g. 20% faster execution for 100% more memory

In my case it was 15% faster execution (give or take), with a 400% memory increase.

This was on a simple view which did nothing, so it's hard to tell how it'd handle more complex views in the app.

Either way this is a huge detour from what this actual topic is about, whether you use PyPy or CPython

I have absolutely no idea how HN replies work, but this is in response to the PyPy memory usage.

I'm optimizing for my application. If you want to use PyPy, use it. I couldn't care less.

If I was having a hard time already maxing CPU due to memory constraints, how does switching to something that will use a very large amount of memory (relative to the CPU gains) make any sense at all? Do you really think "more complex code" is going to use less memory?

If you want benchmarks, go find some, or go create some. It has absolutely nothing to do with the gains I'm pointing out by simple webserver choices and minor tuning.

  $ twistd -n web --wsgi your.wsgi.app
You have been misinformed.