Hello everybody from CairoPlot mailing list,
In the last weeks I've read some articles that made my brain go
psycho (I even forgot about my post-graduation thesis which is due to a
couple of months, I'm sorry). After some days of unstoppable research,
study and coding I came up with something that might be (or not) very
useful for the community. But before anything I must say that I got a
little disappointed with the results.
In short, I've written a C (a shared library) port of CairoPlot and
a Python Binding that I've called ccairoplot (in order to avoid any
conflict with the pure python cairoplot module). Currently it only
supports the horizontal bar plot with some options (rounded border,
margins and grid) and can generate outputs in png and svg. It was a
really straight forward experience in which I've tried to achieve the
same aesthetic standard defined by Rodrigo. This is the compared result[1].
Now the sad part. After some test I haven't achieved a significant
speed improvement as expected. I've written a python test script which
plots 50, 100 and 500 charts, each one with 10, 100 and 300 bars. These
are the results:[2][3]
As you can see, with small values (50x10, 50x100, 100x10, 500x10)
there is a really small improvement (a reduction of 10% or less in the
plotting time). I only achieved a significant speed improvement (close
to 25%) when using big data. Although, I still think that a C
implementation would be beneficial (no only for the Python community)
but for the Open Source as a whole, since the C implementation would
allow bindings for all other languages.
Since this is in a very early development stage the code is (a
little) crappy, undocumented and contains some memory leaks (according
to valgrind), and because of this it still live only on my Hard Drive.
By the way, I've used glib-2.0 (in order to reduce development time) but
in favor to cross-platform I intend to remove this dependency really
soon. Maybe all this aspects together are affecting the performance as a
whole (specially glib which is really huge and a little bloated).
And now I may ask you all: In this community, is there any interest
to keep this project and help it grow? If I remember well, Rodrigo once
said that he probably wouldn't involve himself in a C port of CairoPlot,
so I'm expecting to run this project completely independent from the
original python code which I'll use only and exclusively as a source of
inspiration and pattern guidance.
Despite any possible answer I'll push the source code to GitHub
soon, but I'll wait for the community support in order to use or not the
CairoPlot name. Nevertheless, I've already thought about an alternative
name (just in case). I really believe that this community (and many
others) will back me up, since this is a great project which must be
expanded for all possible languages.
If someone wants to take a look at the code, just ask me and I'll
send a .tar.gz containing the demo code and the build/test script. Now
I'm going to take a rest 'couse I'm at a caffeine outage and my brain is
already at terminall stage.
[1]:
http://www.mindbending.org/files/2012/07/hbar-compare.png
[2]:
http://pastebin.com/ThLR2AJF
[3]:
http://www.mindbending.org/files/2012/07/bench.png
Magnun Leno
------------------
Blog:
http://www.mindbending.org
Twitter:
http://twitter.com/mind_bend
Google+:
http://plus.google.com/b/102063745956138544914/
Facebook:
http://www.facebook.com/MindBendingBlog