13 May, 2007

Boost

While we already had a few KDAB developers hanging and hacking around, we got another visitor: Sebastian Pipping. He happend to be close by, and decided to drop in. He is a Kate developer, currently mainly working on multi-line regular expression search. With the current Kate infrastructure that's pretty hard to do, and he is looking for libraries to make his life easier. Qt won't really help him, as it would be far too slow on big files, and had been looking at Boost. He described the relevant Boost library in pretty euforic statements, but then mentioned he tried to forget about it, as he was convinced Boost was simply not an option, not now, not ever, never... Now I did notice there was some discussion on the kde-devel mailinglist, and even if that wasn't the case - if boost can help so well, it's bad not to be able to consider it, right?

8 comments:

  1. Weren't you complaining about how modern distributions are getting worse and worse regarding their memory footprint, making previously good hardware unusable? Well, that's party because developers are getting sloppy about using huge libraries like Boost.

    I'm sorry, but regular expressions are a geekish tool that most KWrite/Kate users simply don't need.

    ReplyDelete
  2. libraries eating up your resources? right.... much better to not share code (and therefore memory) with anyone?

    so, back to topic:
    there are two boost regular expression libs. the old one, boost::regex, and the realy cool xpressive.
    i think any of those could be used without problems in kde.
    the old one is currently moving into the c++ standard, so boost wouldn't be needed with a recent libstdc++ in a few months. and the other one is a header-only lib, so there are no runtime dependencies.

    links:
    http://boost-sandbox.sourceforge.net/libs/xpressive/doc/html/index.html
    http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/group__tr1__regex.html

    ReplyDelete
  3. Kate users are (also) advanced users, as it is a programmer editor. Already, it has syntax highlighting, auto indent and stuff like that. So, regexp support is essential.

    Anyway, if you have a task, and there is a library that solves it, using that library is almost always faster and better than doing it yourself.

    ReplyDelete
  4. Running free, starting powermanager, running free again, then stopping powermanager and running free yet again only shows me 7-8 MB of memory in use (and that's most likely PyQt/PyKDE overhead since Qt is already in memory, PyQt/PyKDE is only needed when powermanager is running.

    I *do* agree that that's too much, but it's far from the numbers you mention.

    How did you measure?

    ReplyDelete
  5. > Well, that's party because
    > developers are getting sloppy
    > about using huge libraries like
    > Boost.

    Boost is not huge for the user, most of it is template-based, requiring no linking, where only the classes used are instantiated as needed at compile time. So you don't pay for boost classes you do not use. kdepim and kdepimlibs for example use the shared pointer from boost, which is independent from all other boost classes. So the overhead is near to non-existant.

    ReplyDelete
  6. @sebastian: I just installed powermanager again, and used your procedure. I got almost exactly the numbers you gave. as I was really pretty sure we saw what we saw, I wonder how to explain it... anyway, you're right, it's 8 meg now, which might be much, but it's doable imho. sorry about the fuzz...

    ReplyDelete
  7. it's bad not to be able to consider it, right?

    Why, is there a policy that says "No Boost usage in KDE"?

    ReplyDelete
  8. [i]Why, is there a policy that says "No Boost usage in KDE"?[/i]

    afaik not, but the reaction on Sebastian's question whether Boost would be acceptable was such that he didn't even consider asking somewhere/someone/sometime else...

    I don't have a good view of the pro's and con's, but if there's a problem and there's a solution, some thought should be put in it, preferably with an open mind. It's very well possible Boost is no option, but at least the question should be revisited now and then, situations can and do change. And from the discussion with Pipping I didn't feel like it was properly considered, thus my blog...

    ReplyDelete

Say something smart and be polite please!