gupnp-media-server now written in Vala
I finally managed to port all the existing C code to Vala. What did i achieve from this exercise? For one thing, the code got much simpler, with LOCs being reduced from 2101 to 1117 (46.8 %). Also this proves that (at least the server-side) GUPnP's Vala bindings are already in a stable/usable state.
Special thanks to Jürg Billeter, Ali Sabil and Jussi Kukkonen for their continuous support during this exercise and for quickly fixing bugs that I reported.
Special thanks to Jürg Billeter, Ali Sabil and Jussi Kukkonen for their continuous support during this exercise and for quickly fixing bugs that I reported.
Comments
The memory usage remains around 500-600KiB and regarding the performance, I didn't notice any difference at all. My control-point UI is still able to quickly get the results, admitted that I didn't do any systematic comparison/profiling but I seriously doubt there should be any significant overhead introduced by Vala.
In order that nobody gets me wrong I do most of my code in python or mono.
But if vala can give ease of code with C like performance, the world has to know. And you have a good study case here.
How does the performance of Vala applications compare to other applications?
The performance should be pretty similar to GObject/C-based code as there is no Vala-specific runtime library/environment that needs to be loaded. The C compiler can also apply the same optimizations on Vala-generated C code and plain GObject/C code. The Vala compiler uses reference counting in more places than most GObject/C-based applications do. However, Vala allows to fine-tune that easily in performance-critical sections with the weak modifier.
I think it's the first I ever seen being ported like that so I thought it might be interesting to compare, and so, comfort what is assumed in the FAQ of vala.