The difference

A few days ago, on some mailing list, I wrote:

I actually but truly believe that running most GNOME programs under a garbage collector would actually save (a lot) more memory then the virtual machine would add.

In stead of just saying such crazy things, I should of course also prove it. It’s of course not easy to prove this. What I can do is show you two programs that do exactly the same. One program uses Python language bindings. The other doesn’t use language bindings but directly invokes the API in C using GObject.

The two applications loaded the same IMAP folder of ~1000 headers. And unloaded that folder.

The usage of Python bindings causes some Python proxy objects to be created. I think (but I’m not sure) that most of the extra memory that you will see is caused by these.

In Python

In C

Consider that most desktop applications consume more than 20MB and that the test application (tinymail) is designed and developed with low memory consumption in mind, I still believe the overhead introduced by a higher programming language isn’t significant for most desktop applications. Not even for mobile devices with not-so-much memory.

On Mono, the results would probably differ a little bit. But probably not a lot. I indeed hope people will join me on creating good .NET bindings for tinymail.

3 thoughts on “The difference”

  1. Preach it, brother. C is inadequate as a vehicle for our thoughts. Too long now have we been shackled in the chains of this obsolete technology.

Comments are closed.