linux Syndicate content

» Kate/KDevelop Sprint 2014: Let There Be Clang

Mon, 02/03/2014 - 23:58

Time flies… The extremely productive hack sprint at the friendly Blue Systems office in Barcelona is over for more than a week. I haven’t had time to blog about the last days yet which I hereby make good for!

I spent a lot of time at the sprint polishing the KDevelop Clang plugin. A up-to-now semi-secretly developed language plugin based on clang which will replace our current C++ language support in KDevelop in the long-run.

» Kate/KDevelop Sprint 2014: First Days

Tue, 01/21/2014 - 19:24

Hey all! Greetings from the joint Kate/KDevelop sprint at the Blue Systems office in Barcelona!

I only arrived yesterday but already I have great news for you: After months of work I finally merged the sharedurls branches into master for KDevelop/KDevplatform etc. pp. There I worked on a optimization in our handling of file paths.

The status quo up until know was the following: When importing a folder as a project in KDevelop, we filled a model with every file and folder in the project (recursively). For every item we also stored its path as a KUrl to the potentially remote location. KUrl and QUrl are awesome when you have to work with paths and urls, but as soon as you store potentially thousands of them at the same time it becomes quite inefficient. Assume e.g. you open /foo/bar/blub/ which contains /foo/bar/blub/bla.h. When you use KUrl/QUrl to store these paths, you cannot share any memory between the two, as internally basically a QString is used. Thus, when you import deep folder trees or folders with many files, you’ll waste a lot of memory for common sub-paths. Furthermore, due to the amount of allocations required, reading the tree is pretty slow.

So in the sharedurls branch I worked on a internal replacement for KUrl in KDevelop: It’s called KDevelop::Path and is a glorified QVector<QString> with convenience API to simulate a KUrl and simplify porting. Every entry in the vector contains a path segment. It leverages QStrings implicit sharing to minimize the memory overhead. Furthermore, when you parse a tree structure recursively, all you do is copying vectors and appending strings to them - which is rather cheap as a QString is a small handle structure.

So all in all this should greatly improve the performance of opening projects in KDevelop. Especially for large sessions containing thousands of files (eg.: Qt 4, multiple Qt 5 modules, LibreOffice, Kernel, WebKit, …) the new code is much faster and consumes less memory. I’ve seen time savings in the order of multiple seconds in total as well as memory consumption going down in the order of 100MB.

While this sounds like a fairy-tale, I have to admit that it was/is a lot of work: By using a custom class, you have to convert to KUrl/QUrl or QString quite often when interacting with existing API. This of course is costly and potentially marginalizes or even pessimises the potential performance gains. Hence one needs to pay special attention and port code such that it minimizes these conversions. As such I can only recommend anyone doing something like that when you have similar extreme usecase. For a normal file browser or web browser I doubt the you’ll gain much if anything.

So please compile the current master branches and take a look for yourself. My tests and benchmarks look all good, yet I might have overlooked something. If you spot any regressions, please shout!

Now that this is mostly done and polished, I’ll continue working on Clang integration in KDevelop. Stay tuned for the next blog entry about that topic :) And already a huge thank you to Aleix Pol for organizing this sprint, to Blue Systems for having us, and to the KDE e.V. for sponsoring the trip and accommodation!

» KDevelop 4.6.0 released!

Mon, 12/09/2013 - 20:30

Holy moly yet another KDevelop release - but this time a big one! Go and get 4.6.0 while it’s fresh and read the full announcement on the KDevelop website:

http://kdevelop.org/46/kdevelop-460-final-released

» Apps on Speed

Tue, 11/19/2013 - 17:07

Hey all,

since some people asked me: The slides to my extended Apps on Speed talk from this year’s Qt DevDays Berlin are available for download. If you are interested, get them here: http://devdays.kdab.com/wp-content/uploads/2013/11/qt-dd-2013-apps-on-sp…

I hope you liked that talk. I certainly had fun presenting it and discussing the contents with various attendees later on. I have now quite some ideas on how to extend the talk even further.

The slides of the other presentations are also available. Stay tuned for the video recordings of DevDays Berlin, I’m sure they will be accessible soonish :)

Edit: The video is now available! Enjoy http://www.youtube.com/watch?v=C5EPt50Kgmc

» KDevelop 4.6 Beta 1 Available

Mon, 11/11/2013 - 17:16

Hey all,

I just announced KDevelop 4.6 Beta 1 on the KDevelop website. Go read the announcement and test the hell out of this release :) I’m pretty confident that its already a very solid release though!

Cheers, happy hacking!

» KDevelop 4.5.2 available!

Thu, 10/31/2013 - 16:04

Hey all,

KDevelop 4.5.2 is finally released! Go see the announcement on our website for more info: http://kdevelop.org/45/kdevelop-452-available

Note that this release contains some serious crash fixes, so update asap, i.e. as soon as your packagers get to it :)

Enjoy and thanks to all contributors! Looking forward to KDevelop 4.6 already!

» KDevelop Project Filters

Tue, 09/03/2013 - 00:24

Hey all!

Today, after a bit more than a month since I started working on it, I merged the projectfilter branches into KDevplatform/KDevelop. This is a generic configuration interface and library which allows users to customize which folders/files KDevelop includes in a project.

How to use it
Context Menu

The simplest way to use the new code to exclude items from a project, is to use the context menu. Simply right click on any folder/file (not the project root, or anything target related) and choose the “exclude item from project” action. This will then add a filter for the selected item(s). If you want to undo this, go to the project configuration (see below) and remove the filter.

Configuration

For more advanced management of project filters, or to remove filters and/or adapt the default filters, you need to go to the project configuration and select the new “Project Filter” config page. This allows you to add new filters, remove existing ones or edit them, including reordering them.

How it works

The pattern syntax uses QRegExp::WildcardUnix on relative project paths. This should be fairly easy to grasp and similar to what you know from e.g. .gitignore or svn:ignore. Generally, if you can write a .gitignore file then you should be able to configure your KDevelop project as well!

If you wonder what you can do with the include/exclude pattern type, see again the documentation of .gitignore and it’s !pattern syntax. It allows you to selectively unhide some paths which where previously hidden. E.g. you can only show *.cpp files in your project by first excluding all files * and then adding an inclusive pattern for *.cpp.

Note that the distinction between files/folders is probably not required most of the time. It does allow for some better performance though and may make some patterns more easy to write.

Note to Users-Who-Compile-Master-From-Source

Those of you who build KDevelop/KDevplatfrom from git master, please make sure to remove kcm_kdev_genericprojectmanagersettings.so and just to make sure also remove kcm_kdev_genericprojectmanagersettings.desktop. Otherwise you’ll get the old generic manager configuration alongside the new project filter, which may break things.

If you install KDevelop via the package manager of your distribution, you should have nothing to do but wait until we release a new KDevelop version (4.6) which will then include this new feature!

Anyhow, please test this and report bugs on bugs.kde.org. Feature requests also welcome, but I like that this new UI is rather simple and still powerful. I’m reluctant to add more here. Something which I do want to implement in the future though is support for reading e.g. .gitignore files and hiding files based on that from the project. The new API I added to KDevplatform should make this rather easy btw. You/I just have to write a new plugin implementing the IProjectFilterProvider interface and then we could e.g. query git directly for whether a given path is included or not.

Cheers!

» Akademy 2013 - A Blast!

Sat, 07/20/2013 - 01:23

Wow…

I’ve been gone for eight days and returned just a few hours ago to Berlin. It doesn’t feel like that. The last days went by in a blur of awesomeness! The reason why I didn’t write a single blog post in between is just that I never had a spare minute for that. I arrived on Thursday and instantly enjoyed the warmth of Spain / the Basque country and had a tasty and cheap Menu del Dia at a local Restaurant with fellow KDABians and other KDE friends. Then just a few hours later the first party started, near the old district of the city - amazing! More and more hackers and helpers arrived, the atmosphere was once again so good. The social aspect of this years Akademy was without comparison in my opinion - seriously: Hats off to the local team, you did an amazing job!

While the social events on the following days have been just as awesome or even awesomer to awesomest - I especially enjoyed the day trip and jumping into the ocean! - the technical side of Akademy delivered just as well: My favorite talks this year where Mirko’s about ThreadWeaver, which we heavily use in KDevelop. His roadmap and polished API looks much better than what we have nowadays and should allow for much nicer code which might even perform better - kudos!

Similarily, I liked Volker’s talk about Expression Templates and Kevin Krammer’s presentation of Declarative Widgets a lot. Both of them are colleagues of mine, so the contents weren’t that new to me - yet hearing it all in a concise and entertaining manner is always worth it. The crowd also seemed to enjoy it. Martin Grässlin’s talk about being the 1% corner case was also highly entertaining and gave a very interesting insight into the problems he tackles day to day.

There have been other, less technical talks, which I also appreciated greatly: Kevin Otten’s visionary roadmap for KDE as a community or Till’s highly entertaining presentation of BlackBerry. Which brings me to the sponsors - many thanks! Without them, this year’s event would surely not have been as good as it was!

Oh boy, I already wrote a lot, yet only covered the first three days… After the AGM and presentations on the week end followed a full week of highly educational BoF’s - both around KDE topics (such as KF5, KDevelop, …) or “plain” Qt during the Qt Contributor Summit. This was my first time attending the QtCS and I definitely want to see more of this! Discussing the future of QtWebKit and learning more about whats cooking in QtCore was certainly worth it. Being in contact to the QtCreator and QML guys also helps from a tooling point of view in general and from a KDevelop pov in particular. Oh and we got a nice BlackBerry Z10 phone - many thanks for that!

The afternoons are mostly a blur - I mostly remember lots of Foosball, Socializing, Drinking, meeting Friends of Old and New, Eating, Partying etc. pp.

Anyhow, I think I need to stop here.

tl;dr; Thank you local KDE team for organizing such an awesome Akademy + QtCS 2013! Thank you Sponsors for making this possible!

PS: All of you who attended talks on the weekend: Go and rate them! The speakers will love you and provide you with even better talks next year! Go to either the page for the talks on saturday or the talks on sunday, then pick the sessions you attended and finally hit the “Feedback” link!

PPS: I definitely have to come back to the Basque country, the country side looked beautiful and Bilbao alone is worth the trip! And I didn’t even have time to visit the Guggenheim…

Cheers, see you next year you insane awesome crowd of KDE people!

» Valgrind Highlighting on BKO

Thu, 07/04/2013 - 19:30

Hey all,

you didn’t hear anything from me since quite some time… Thing is, this is my last “regular” semester of university where I have two lab courses that are very time demanding. The year after, I’ll be spending time on my master thesis, which hopefully will allow for some more leisure time for KDE.

Anyhow, a small project which I just worked on to write some small lines of code again was to make my BKO backtrace highlighter work on Chromium. It requires the Tampermonkey extension to get more compatibility with Greasemonkey of Firefox fame, otherwise it works more or less out of the box!

After fixing some small other inconsistencies I can now say that it works fine in both, Firefox and Chromium! I furthermore took the liberty to extend its functionality a bit: You now also get highlighted Valgrind traces, i.e. generated by memcheck and other error reporting tools - yay!

highlighting of a Valgrind memcheck trace on bugs.kde.org with additional navigation helpers, using Chromium
highlighting of a Valgrind memcheck trace on bugs.kde.org with additional navigation helpers, using Chromium

Oh and before I forget it: See you all next week at Akademy! I’m so looking forward for the intense hacking and socializing, esp. since I missed last year! And: If you are interested in how to improve the performance of your application(s), make sure to attend my talk on Sunday: Apps On Speed

» Progress on JavaScript language support in KDevelop

Sat, 01/26/2013 - 17:06

During the sprint in Vienna last year, Aleix and me laid the ground work for a QML/JS language support plugin for KDevelop. Sadly we two only have very limited time working on fancy new features such as that.

Thankfully someone stood up and started contributing - none other than Andrea Scarpino of ArchLinux KDE/Qt packaging fame. With some help of me and Sven he managed to get the JavaScript support into a much more shiny state - behold:

Colorful JavaScript Analysis in KDevelop
Colorful JavaScript Analysis in KDevelop

For simple JavaScript files we already have proper context browsing, uses and declarations. And all that in just a few lines of code thanks to the good work of the QtCreator team, whose JavaScript/QML parser we use (which is the one of the most complicated parts of a language support plugin). Thanks again, guys!

The next steps on the JavaScript side will be proper support for objects and prototypes - I’m interested to see how we can cope with that. Then we’ll need support for built-in APIs such as DOM window, document and such. But we’ll keep the other use-cases of JavaScript in mind, like using it to extend your own applications (see e.g. Kate).

Anyone else out there who wants to help? Or maybe someone wants to work on our QML support? We KDevelop hackers would be happy to help!