linux Syndicate content Syndicate content

» Transparent loading of compressed Callgrind files in KCacheGrind

Thu, 03/11/2010 - 23:43

Hey everyone!

I just committed an (imo) insanely useful feature for KCacheGrind: Transparent loading of compressed Callgrind files. Finally one does not have to keep those Callgrind files around uncompressed, hogging up lots of space. And what is even more important: It’s much easier to share these files now, as you can send or upload them as .gz or better yet .bz2 and open them directly. KDE architecture just rocks :) So in KDE 4.5 the best profiling visualizer just got better :D

In related news: I’m spending my time as intern at KDAB currently by creating an application to visualize Massif. If you are interested, check the sources out on gitorious: http://gitorious.org/massif-visualizer

It’s still pretty limited in what it offers, yet is probably already more useful than the plain ASCII graph that ms_print generates:

visualization of massif data
Visualization of a Massif output file

This is very WIP but the visuals are somewhat working now. I plan to make the whole graph react on user input, i.e. zoomable, click to show details about snapshots, show information about the heap items that make up the stacked part of the diagram, …

Also very high on my wish list is some kind of interaction with the KCacheGrind libraries, to reuse it’s nice features like callgraphs, cost maps, etc. pp. you name it :) All these features that make KCacheGrind such an insanely useful application.

Oh and remember: Never do performance optimizations without checking the facts first ;-)

» Snippets In KDevelop / Kate

Wed, 02/03/2010 - 17:59

Hey all!

Just wanted to give you a little rundown on Snippets in Kate 4.4 (via the snippets_tng plugin) and KDevelop Beta 8 (soon to be released).

Note: The Kate plugin was written by Jowenn and introduced me to all these nice features. For KDevelop I wrote a somewhat simpler yet imo better implementation. We will try to get the best of both worlds into KDE 4.5. Stay tuned!

General Usage & Features
  • create a snippet repository (or download via GHNS [see below])
  • create snippets in that repository
  • insert snippets via the snippets view (i.e. double click), or (imo better/faster) insert them via code-completion (remember: CTRL + Space requests code completion at the current cursor position!).
  • snippet gets inserted (properly indented) and potential placeholders/variables get expanded. A variable is something like %{date} or ${email}. Also take a look at the API documentation.
  • variables that get inserted via “${…}” will be “selectable”, meaning you can jump from one var to the other by hitting TAB / Shift TAB
  • the %{...} vars will only get expanded and inserted, without getting selectable.
  • multiple occurrences of the same variable will be updated once one of them gets edited, something that is called “mirroring” in other editors.
  • once one edits ESC the cursor is placed at the end of the snippet or to the first occurrence of ${cursor} or %{cursor} and the user types something, the snippet-handler quits and you are left with your normal editor until you insert the next snippet
  • nested snippets (i.e. insert snippet than insert another one) should “just work”.
Snippet Management
  • group snippets by file type, i.e. PHP snippets will only be offered during code completion when one edits a PHP file.
    Note: In KDevelop and KDE 4.4 nested documents are supported, e.g. create a CSS snippet and it will be shown inside the CSS parts of a HTML document or similar. This uses my HighlightInterface I wrote for KDE 4.4. I still have to rewrite some parts of the snippets_tng plugin for Kate so that it works there as well
  • group snippets in repositories, set an Author and a License of your choice
  • publish snippet repositories via GHNS: In Kate you can already download snippets from GHNS but we sadly don’t have any repos up on opendesktop… I’ll have to add some prior to KDE 4.4. Also we didn’t have enough time to implement uploading of Repos from inside Kate in time for KDE 4.4. So stay tuned for KDE 4.5. KDevelop currently has no support for GHNS, but I plan to fix this tomorrow or the next days - together with uploading from inside KDevelop, i.e. all the nice features of GHNS v3.
  • in KDevelop (and someday in Kate as well) you can simply select a part of your currently opened document and select the “create snippet from selection” in the ContextMenu - easy & fast!
TODO

There’s much to do.

  • Highest priority right now for me is to get GHNS with all bells and whistles supported for KDevelop.
  • Then I’ll merge and integrate the Kate & KDevelop plugins as much as possible, so we have a reduce code base.
  • Also important is to make all shortcuts configurable
  • Another thing is: How could we improve interoperability even between e.g. editors like TextMate or Gedit? Both have snippets features and their bundles are available in the net. If we can support those we’d save us a lot of work

Also, I should probably do a screencast… Not now though ;-)

» FOSDEM, 4.4 release party in Berlin, ...

Thu, 01/28/2010 - 00:56

Hey everyone, just a quick blurp:

FOSDEM

Yeah, I’ll go to FOSDEM! Will be my first time, I’m really looking forward to it. Esp. considering that it marks the end of my current semester. My current plan for the following days is:

  • visit relatives & friends
  • go to FOSDEM
  • get an immense overload of hacking at the Kate/KDevelop sprint
  • start working as an intern at KDAB

Looks like the future will be much fun :)

But back to FOSDEM: If you have any questions about Kate/KDevelop/PHP, visit me at the KDE booth. I’ll also attend Aleix’s talk about KDevelop for sure.

4.4 release party in Berlin

So well, Nighrose poked me on IRC and I added a short note about a small get-together on the 13th in Berlin. I’m reluctant to call it release party since it’ll be at the rented flat for the Kate/KDevelop sprint attendees, hence only a limited number of people can attend. But esp. other KDE/Qt/KDAB hackers in Berlin & vicinity are welcome. If you want to come by, take a look at the wiki notes about the “party” and contact me by mail.

If anyone else has a bigger party planned, please tell us. We’d be a horde of 10+ hackers, ready to crash anything :)

» Kate polishing

Thu, 01/21/2010 - 02:09

Phew, I just finished some last-minute backports to the KDE 4.3.5 branch. Lets hope the bug fixes I and pletourn did are as good as they look. Expect a much more stable Kate for 4.3.5 & 4.4! We managed to fix two bugs which are potentially the cause for dozens of bug reports, all seemingly random. Lets see whether our fixes hold up to our hopes!

Other than that: You should look forward to Kate scripting (with JavaScript) in 4.4. It’s dead simple but actually useful. In the utils.js file we ship with Kate there are now the following tools (all operate on the selection or - if none exists - on the whole document):

  • sort - simple sorting
  • natsort - natural sorting
  • uniq - filter duplicates
  • trim - remove leading & trailing whitespace
  • ltrim - remove leading whitespace
  • rtrim - remove trailing whitespace

Do you have more ideas for such simple helper functions?

» progress in PHP support for KDevelop

Wed, 01/20/2010 - 14:44

Hey everyone. Been some time since I last blogged… I want to take the chance to give you all a bit of overview over the last changes in the PHP plugin for KDevelop:

Performance Improvements

I spent quite some time profiling various aspects of the PHP plugin, be it parsing and DUChain building over to (just yesterday) code completion. I’m confident to say that I found (and removed) quite a few bottlenecks, making the plugin much more comfortable to use.

I’m really blown away time over time again by valgrind & KCachegrind… What would we do without these tools?

Documentation

An (imo) very strong point for using KDevelop for PHP programming is it’s seamless support for documentation. Be it the “simple” inline documentation in the Declaration Tooltips or the extended integration of the remote PHP.net docs. But these past days I improved our generator for the inline documentation of built-in PHP language constructs considerably:

  • add documentation for function/method parameters
  • add @since where appropriate
  • fix some missing declarations or bugs, esp. some that where part of SPL

These changes increased the size of the generated file to whopping 3.1M. This was too much for me and hence I added support to ship this file zipped (i.e. now it’s 80% smaller) and we decompress it transparently with the use of KZip. Adding such a feature was a breeze, so nice to work with the KDE Api :)

There are still a few things missing and stuff I plan to improve here, so stay tuned for more news in this regard.

» PHP & PHP-Docs now in extragear/sdk/kdevelop-plugins

Fri, 01/08/2010 - 18:58

Hey everyone! The PHP & PHP-Docs plugins for KDevelop now moved to Extragear! The new locations are:

  1. svn+ssh://svn.kde.org/home/kde/trunk/extragear/sdk/kdevelop-plugins/php
  2. svn+ssh://svn.kde.org/home/kde/trunk/extragear/sdk/kdevelop-plugins/php-docs

Or the anonsvn equivalent:

  1. svn://anonsvn.kde.org/home/kde/trunk/extragear/sdk/kdevelop-plugins/php
  2. svn://anonsvn.kde.org/home/kde/trunk/extragear/sdk/kdevelop-plugins/php-docs

Happy coding!

» Will code for food

Tue, 12/22/2009 - 05:34

Ha, what a bit of a bribe can do to me… Someday earlier today a user of the PHP plugin for KDevelop brought up the flickering issue in it again. Well as I told him: I myself find it very annoying and wanted to fix it since quite some time, but never got around to it… Usually that would be it and I’d go watch some more FamilyGuy until I’m in the mood to track this bugger down. But well, thankfully Phlogi wasn’t so easy to dispatch:

<Phlogi> milian: ok… I’ll send you pizza and beer if you fix this!

Hours of gdb sessions later, I finally committed a fix. So Phlogi, if you read this: You owe me ;-)

To all others: If you tried the PHP plugin out and the flickering was too much for you: Give it a try again! I’m personally totally overwhelmed, the difference is huge! I often perceived the PHP plugin to be magnitudes slower than the C++ one. Well, looks like most of this was only due to the flickering. Now things are much smoother.

Happy holidays!

» PHP and PHP-Docs plugins now up for review (meaning: SVN location moved!)

Thu, 12/17/2009 - 22:29

Hey all!

Just a quick note: Niko and me moved PHP & PHP-Docs to kdereview, we hope to move both plugins to extragear/sdk/kdevelop-plugins. So, if I understood things correctly, after a two week period the plugins will get moved there (well, if we pass the review, but I think we can do that).

So for anybody that uses the plugins from SVN, you’ll have to relocate. The new addresses are:

  • /trunk/kdereview/kdevelop-php
  • /trunk/kdereview/kdevelop-php-docs

See you in two weeks :)

» KDevelop & KWrite/Kate hacksprint 2010 in Berlin

Mon, 11/16/2009 - 16:38

Hey everybody!

If you are a KDevelop and/or Kate/Kwrite developer and do not read the mailing lists: There’s a hack sprint coming up in Berlin in 2010. I think there’ve been enough sprints in Berlin already so that you know it’s a great city for such an event. Though this time it won’t be at KDAB or Nokia offices, but at the Physics Faculty of the FU-Berlin. Since I (currently) work there as an IT admin, it was my first choice and worked out. I hope it will be a good location for the meeting. If you want to attend, vote on doodle:

http://www.doodle.com/vkyh9up9794zr4s8

But you probably also should register either on the KDevelop or KWrite mailing lists so I have some kind of way to contact you.

PS: in unrelated news I’ll do an internship at KDAB next year! yay

» Improving KDevelop-PG-Qt

Mon, 10/26/2009 - 19:13

Good news everyone :)

Documentation

After years of pretty much no documentation (except looking at the sources…), The_User aka. Jonathan Schmidt-Dominé started documenting the parser generator that is used for most KDevelop language plugins (java, python, php, …). You can find it here: http://techbase.kde.org/Development/KDevelop-PG-Qt_Introduction

It has to be improved and more examples have to be put in there, but it’s already a huge improvement over the situation before…

Performance

In related news I did some profiling on the parsing of the quite big file that includes all internal PHP declarations (i.e. all functions, classes, definitions,…). It drops in at a whopping 1.9M, with ~80k lines. Well, turns out that this showed a pretty easy to fix bottleneck in KDevelop-PG’s LocationTable, which used to use a linear lookup algorithm. Profiling showed that nearly 75% was spent in that function. But I used the past tense for a reason:

I replaced it with an algorithm that combines a relative search (i.e. relative to the last lookup) with a binary search fallback. That’s comparatively blazingly fast. I added some benchmarks to KDevelop-PG-Qt that proofs that (benchmark below run with release mode build):

  1. ********* Start testing of KDevPG::Benchmarks *********
  2. Config: Using QTest library 4.5.2, Qt 4.5.2
  3. PASS : KDevPG::Benchmarks::initTestCase()
  4. RESULT : KDevPG::Benchmarks::positionAt():"initial, linear":
  5. 1,184.0 msec per iteration (total: 11840, iterations: 10)
  6. RESULT : KDevPG::Benchmarks::positionAt():"initial, random":
  7. 1,008.5 msec per iteration (total: 10085, iterations: 10)
  8. RESULT : KDevPG::Benchmarks::positionAt():"relative, linear":
  9. 1.3 msec per iteration (total: 14, iterations: 10)
  10. RESULT : KDevPG::Benchmarks::positionAt():"relative, random":
  11. 1,185.0 msec per iteration (total: 11850, iterations: 10)
  12. RESULT : KDevPG::Benchmarks::positionAt():"binary, linear":
  13. 31.1 msec per iteration (total: 312, iterations: 10)
  14. RESULT : KDevPG::Benchmarks::positionAt():"binary, random":
  15. 39.2 msec per iteration (total: 392, iterations: 10)
  16. RESULT : KDevPG::Benchmarks::positionAt():"binary & relative, linear":
  17. 0.8 msec per iteration (total: 8, iterations: 10)
  18. RESULT : KDevPG::Benchmarks::positionAt():"binary & relative, random":
  19. 40.2 msec per iteration (total: 402, iterations: 10)
  20. PASS : KDevPG::Benchmarks::positionAt()
  21. PASS : KDevPG::Benchmarks::cleanupTestCase()
  22. Totals: 3 passed, 0 failed, 0 skipped
  23. ********* Finished testing of KDevPG::Benchmarks *********

In our “realworld” phpfunctions.php example the DUChain building process got twice as fast (in debug mode though, but still).

We should probably get lost of the LocationTable altogether and use an existing container (QList, QVector, QLinkedList,… or any STL variant of them). But this would mean more profiling, and well, lets see when we get to it… But just got a reply on the KDevelop list showing interest on this, so maybe someone does that eventually!

Profiling rocks, and KCacheGrind is such a great application. I love such visualization. Well done! And the QTestLib benchmark utilities are also very solid, nice!

PS: KDevelop beta6 is in the pipelines and we’ll release a beta1 of the PHP plugin together with it. Packagers and users rejoice :)