Python a hungrier beast than Ruby?

B

baalbek

I have tested two implementations of wxRuby/wxPython applications (stock
price data displayed as a simple graph, and as candlesticks).

The Python implementation only showed graphs from one company, while the
Ruby implementation showed graphs from ten compaines.

When I checked the memory usage, I was, quite frankly, stunned:

wxPython: 19 Mb memory usage
wxRuby: 11 Mb memory usage


What on earth is going on here?

The Ruby wx application is ten times larger than the Python wx
application, but only use 50% of the memory of Python.

Is it somehow a super optimized wxRuby as far as memory goes, or is Ruby
just more lean with memory resources than Python?

Baalbek
 
C

Curt Hibbs

I have tested two implementations of wxRuby/wxPython applications (stock
price data displayed as a simple graph, and as candlesticks).

The Python implementation only showed graphs from one company, while the
Ruby implementation showed graphs from ten compaines.

When I checked the memory usage, I was, quite frankly, stunned:

wxPython: 19 Mb memory usage
wxRuby: 11 Mb memory usage


What on earth is going on here?

The Ruby wx application is ten times larger than the Python wx
application, but only use 50% of the memory of Python.

Is it somehow a super optimized wxRuby as far as memory goes, or is Ruby
just more lean with memory resources than Python?

All I can is is that neither Ruby nor wxRuby is super optimized. The
resources that they take are just what they naturally are without any
heroic efforts.

I can't speak to the Python side.

Curt
 
M

Mc Osten

Il 11-03-2006 baalbek ha scritto:
What on earth is going on here?

Did you run the tests on Windows? On GNU/Linux (which distro?)
How did you install both ruby and python and the libraries?

Where debugging infos included ect etc?

Anyway here (MacOS X) the bare ruby interpreter takes less memory than
Python one. Anyway this does not prove anything. Still I have no idea
why this happens.
 
B

baalbek

Mc said:
Did you run the tests on Windows? On GNU/Linux (which distro?)
How did you install both ruby and python and the libraries?

Where debugging infos included ect etc?
On Windows.

I simply ran the Python wx application with one of the wxPanels, and the
Ruby wx app with 10 of the wxPanels (including the wxPanel Python ran).

Then I checked the memory usage for each application (by the resource
manager in Windows).

The installs of both were standard installation exe's downloaded from
the net.

If debugging info were included, this I don't know; how would one check
if Ruby/Python runs with debugging info (using wx)?

Regards
baalbek
 
M

Mc Osten

baalbek ha scritto:
If debugging info were included, this I don't know; how would one check
if Ruby/Python runs with debugging info (using wx)?

You can check on the documentation of the packages. I suppose that it
could be possible that just some libs (for example the wx dll) is
compiled with debugging on.
However, I think this is not the case. Standard packages should not
include debugging... don't know, I haven't a win machine here right now.
 
L

Logan Capaldo

I have tested two implementations of wxRuby/wxPython applications
(stock price data displayed as a simple graph, and as candlesticks).

The Python implementation only showed graphs from one company,
while the Ruby implementation showed graphs from ten compaines.

When I checked the memory usage, I was, quite frankly, stunned:

wxPython: 19 Mb memory usage
wxRuby: 11 Mb memory usage


What on earth is going on here?

The Ruby wx application is ten times larger than the Python wx
application, but only use 50% of the memory of Python.

Is it somehow a super optimized wxRuby as far as memory goes, or is
Ruby just more lean with memory resources than Python?

Baalbek

Random theory, (which could be tested by looking at the source)
Python maybe grabs bigger chunks of memory from the OS at a time. If
ruby allocates 1024K at a time from the OS and python allocates 2048K
at a time from the OS the python memory would appear larger even if
the invidual python objects were slightly smaller or the same size as
the ruby objects (assuming tha each program creates a similar number
of objects).
 
A

Aaron Lee

baalbek said:
I simply ran the Python wx application with one of the wxPanels, and the
Ruby wx app with 10 of the wxPanels (including the wxPanel Python ran).

Then I checked the memory usage for each application (by the resource
manager in Windows).

Windows may be doing something funny with the shared libraries. Just for
kicks, what does it look like when you open the Ruby one first, then the
Python one?
 
B

baalbek

Aaron said:
Windows may be doing something funny with the shared libraries. Just for
kicks, what does it look like when you open the Ruby one first, then the
Python one?

Same thing, whichever I open first.

HOWEVER, I might have found the cause:

the ruby application uses a database connection through drb, while the
Python application uses its own database connection.

My bad, that I did not think of this before posting on the ng...sorry!

Baalbek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top