← Back to team overview

ubuntu-phone team mailing list archive

[Calendar App] Commit 3: Initial C++ code ported to pure QML/JS

 

Hi all,

I just finished porting my initial C++ code to full QML/JS and I though I might
share my first experience with V8. The number of code lines where at least halved.
The two C++ model classes disappeared in two lines of code. Performance-vise I run
into issues initially with object instantiation. Accidentally I instantiated each day
item for the flickable month view at component construction time. I had to kill qmlscene
after a minute of waiting. Generally item instantiation seems to be pretty expensive, but
when it's up and running pure QML seems to run more fluently. My guess is that JS/V8 is
doing realtime memory allocation more cleverly than Qt/C++, but I don't really care
as long as it's working.
By the way I'm working on a Lenovo Edge equipped with a Turion limited at 800Mhz.
I don't think that any mobile device released this year will be slower;)

I also pushed a small JS library file with the pragma style as shown in the notepad-qml
example. I started using the built-in Date object of Javascript and opted for extending
it where functions seem to be missing (ideally with the same method names as in QDate).
Like the last time I'm just pushing here some code to the public master branch
without brothering much, if it breaks something somewhere. I'm used to follow this
simple First Come First Service strategy from my commercial projects. Means, if you
push some code first, you have to perform the SERVICE (yes in big letters) to listen
to anybodies complaints and merge their stuff if it conflicts with your changes.

Cheers,
Frank

-- 
gplus.to/frankencode
frankencode@freenode


Follow ups