News for hackers. Stuff that matters.
Re:Go vs. Python for a simple web server by DocSavage on Wednesday June 22, 2011 @09:32AM (#2682996)
While this article discusses some pros/cons of Go for implementing a web server, I'm surprised there's absolutely no mention of how fast his working (?) server runs or the memory footprint relative to python.
Re:Go vs. Python for a simple web server by briancurtin on Wednesday June 22, 2011 @09:38AM (#2683020)
When I read "In addition, threading in Python performs poorly due to GIL." and then just leaving it at that, I wasn't expecting any sort of performance or resource usage investigation.
Re:Go vs. Python for a simple web server by alec on Wednesday June 22, 2011 @09:46AM (#2683053)
When I read "I would seriously consider using Go for writing server side of web applications as it provides a right balance between speed and memory efficiency of the running code", I was expecting at least some number to back it up.
Re:Go vs. Python for a simple web server by sc68cal on Wednesday June 22, 2011 @11:37AM (#2683586)
Agreed. If we want to nitpick further regarding the GIL - Python boosters could state that the GIL is just a implementation detail of cPython that is not a problem in other implementations, like Jython or IronPython.
Re:Go vs. Python for a simple web server by kjksf on Wednesday June 22, 2011 @02:19PM (#2684391)
It's a fair point. However, when I did that port, almost a year ago, I did it to understand how Go compares to Python in terms of writing the code. The result was fast enough, I didn't bother benchmarking.

Plus, whatever the results were then, Go's compiler and runtime has improved in the past year, so the data would no longer be indicative of current performance. And the compiler is still being improved.

Re:Go vs. Python for a simple web server by ch0wn on Wednesday June 22, 2011 @11:25AM (#2683509)
"don’t suffer Python’s terrible per-object overhead"

Yet another example of where I'd love to see some numbers.

Re:Go vs. Python for a simple web server by kragen on Wednesday June 22, 2011 @01:03PM (#2684022)

    kragen@inexorable:~$ python
    Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39) 
    [GCC 4.4.5] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os, commands
    >>> print commands.getoutput('ps u %s' % os.getpid())
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    kragen   20823  0.3  0.1   9636  3780 pts/4    S+   14:00   0:00 python
    >>> x = [{} for ii in range(1000*1000)]
    >>> print commands.getoutput('ps u %s' % os.getpid())
    USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
    kragen   20823 10.8  7.7 168176 159756 pts/4   S+   14:00   0:02 python
    >>> (159756-3780)*1024/(1000.0*1000)
    159.719424
So the baseline is about 160 bytes per dict. Objects, by default, are built on dicts. Objects with __slots__ can be a little more efficient.
Re:Go vs. Python for a simple web server by uriel on Wednesday June 22, 2011 @04:09PM (#2684981)