Skip to content

Wednesday, 28 June 2023

And what about…

While talking about the build time improvements seen by avoiding the use of Qt module header includes Volker Krause wondered: in chat

regarding the compile time improvements, I have the suspicion that included moc files would help with incremental build times, possibly even quite noticeably (compiling the combined automoc file can be quite expensive), but no idea how that impacts clean builds

And while he was occupied with other things, this suspicion caught my interest and curiousity, so I found some slots to give it some closer look and also learn some more.

After all, people including myself had removed quite some explicit moc includes by the years, also in KDE projects, enjoying existing automoc magic for less manual code. Just that in the mean time, as soon noticed, Qt developers had stepped up efforts to add them for the Qt libraries were missing, surely for reasons.

Back to the basics…

Let’s take a simple example of two independent QObject sub-classes Foo and Bar, with own header and source files:

foo.h: class Foo : public QObject { Q_OBJECT /* ... */ };

bar.h: class Bar : public QObject { Q_OBJECT /* ... */ };

foo.cpp: #include "foo.h" /* non-inline Foo method definitions */

bar.cpp: #include "bar.h" /* non-inline Bar method definitions */

CMake’s automoc will detect the respective Q_OBJECT macro usages and generate build system rules to have the moc tool create respective files moc_foo.cpp and moc_bar.cpp, which contains the code complementing the macro (e.g. for the class meta object).

CMake then, if no source files include those generated moc files, will have added rules to generate for each library or executable target a central file mocs_compilation.cpp which includes those:

// This file is autogenerated. Changes will be overwritten.
#include "<SOURCE_DIR_CHECKSUM>/moc_foo.cpp"
#include "<SOURCE_DIR_CHECKSUM>/moc_bar.cpp"

This results in a single compilation unit with all the moc code. It is faster to build compared to compiling all moc files in separate ones. Note the “all” here, as all moc code only needs to be build together in full project (re)builds.

Incremental build, wants to handle minimal size of sources

When working on a codebase, one usually does incremental builds, so only rebuilding those artifacts that depend on sources changed. That gives quick edit-build-test cycles, helping to keep concentration stable (when no office-chair sword duel tournaments are on-going anyway).

So for the example above when the header foo.h is edited, in an incremental build…

  1. the file foo.cpp is recompiled as it includes this header…
  2. next moc_foo.cpp to be regenerated from the header and then…
  3. mocs_compilation.cpp to be recompiled, given it includes moc_foo.cpp.

Just, as mocs_compilation.cpp does not only include moc_foo.cpp, but also moc_bar.cpp, this means also the code from moc_bar.cpp is recompiled here, even if does not depend on foo.h.

So the optimization of having a single compilation unit for all moc files for headers, done for full builds, results in unneeded extra work for incremental builds. Which gets worse with any additional header that needs a moc file, which then also is included in mocs_compilation.cpp. And that is the problem Volker talked about.

Impact of mocs_compilation.cpp builds

On the author’s system (i5-2520M CPU @ 2.5 GHz, with SSD) some measurements were done by calling touch on a mocs_compilation.cpp file (touch foo_autogen/mocs_compilation.cpp), then asking the build system to update the respective object file and measuring that with the tool time (time make foo_autogen/mocs_compilation.cpp.o).

To have some reference, first a single moc file of a most simple QObject subclass was looked at, where times averaged around 1.6 s. Then random mocs_compilation.cpp found in the local build dirs of random projects were checked, with times measured in the range of 5 s to 14 s.

Multiple seconds spent on mocs_compilation.cpp, again and again, those can make a difference in the experience with incremental builds, where the other updates might take even less time.

Impact of moc include on single source file builds

Trying to measure the cost which including a moc file adds to (re)compiling a single source file, again the tool time was used, with the compiler command as taken from the build system to generate an object file.

A few rounds of measurement only delivered average differences that were one or two magnitudes smaller than the variance seen in the times taken, so the cost considered unnoticeable. A guess is that the compiler for the moc generated code added can reuse all the work already done for the other code in the including source file, and the moc generated code itself not that complicated relatively.

This is in comparison to the noticeable time it needs to build mocs_compilation.cpp, as described above.

Impact of moc includes on full builds, by examples

An answer to “no idea how that impacts clean builds” might be hard to derive in theory. The effort it takes to build the moc generated code separately in mocs_compilation.cpp versus the sum of the additional efforts it takes to build each moc generated code as part of source files depends on the circumstances of the sources involved. The measurements done before for mocs_compilation.cpp and single source files builds though hint to overall build time reduction in real-world situations.

For some real-world numbers, a set of patches for a few KDE repos have been done (easy with the scripts available, see below). Then some scenario of someone doing a fresh build of such repo using the meta-build tool kdesrc-build was run a few times on an otherwise idle developer system (same i5-2520M CPU @ 2.5 GHz, with SSD), both for the current codebase and then with all possible moc includes added.

Using the make tool, configured to use 4 parallel jobs, with the build dir always completely removed before, and kdesrc-build invoked with the –build-only option, so skipping repo updates, the timing was measured using the time tool as before. Which reports by “real” the wall clock timing, while “user” reports the sum of times of all threads taken in non-kernel processor usage. The time spent by related kernel processing (“sys”) was ignored due to being very small in comparison.

The numbers taken in all cases showed that there clean builds got faster with moc includes, with build times partially reduced by more than 10 %:

Before“moc includes”ReductionAverage ofVariance
LibKDEGames (MR)real1m 02,18s0 min 58,46 s6 %5 runs2 s
user3m 06,37s2 min 48,13 s10 %3 s
KXmlGui (MR)real2 min 26,62 s2 min 09,09 s12 %3 runs
user7 min 34,42 s6 min 35,07 s13 %
Kirigami (MR)real1 min 32,83 s1 min 29,79 s3 %3 runs
user4 min 25,67 s4 min 19,94 s2 %
NetworkmanagerQt (MR)real11 min 48,10 s11 min 18,57 s4 %1 run
user40 min 39,78 s39 min 05,28 s4 %
KCalendarCore (MR)real3 min 09,91 s2 min 42,83 s14 %3 runs
user10 min 17,57 s8 min 54,90 s13 %

Further, less controlled own time measurements for other codebases support this impression, as well as reports from others (“total build time dropped by around 10%.”, Qt Interest mailing list in 2019). With that for now it would be assumed that times needed for clean build are not a reason against moc includes, rather the opposite.

And there are more reasons, read on.

Reducing need for headers to include other headers

moc generated code needs to have the full declaration of types used as values in signals or slots method arguments. Same for types used as values or references for Q_PROPERTY class properties, in Qt6 also for types used with pointers:

class Bar; // forward declaration, not enough for moc generated code here

class Foo : public QObject {
    Q_OBJECT
    Q_PROPERTY(Bar* bar READ barPointer) // Qt6: full Bar declaration needed
    Q_PROPERTY(Bar& bar READ barRef)     // full Bar declaration needed
    Q_PROPERTY(Bar bar  READ barValue)   // full Bar declaration needed
Q_SIGNALS:
    void fooed(Bar bar); // full Bar declaration needed
public Q_SLOT:
    void foo(Bar bar);   // full Bar declaration needed
    // [...]
};

So if the moc file for class Foo is compiled separately and thus only sees the given declarations as above, if will fail to build.

This can be solved by replacing the forward declaration of class Bar with the full declaration, e.g. by including a header where Bar is declared, which itself again might need more declarations. But this is paid by everything else which needs the full class Foo declaration now also getting those other declarations, even if not useful.

Solving it instead by including the moc file in a source file with definitions of class Foo methods, with full class Bar declaration available there, as usually already needed for those methods, allows to keep the forward declaration:

#include "foo.h"
#include "bar.h" // needed for class Foo methods' definitions
// [definitions of class Foo methods]
#include "moc_foo.cpp" // moc generated code sourced

Which keeps both full and incremental project builds faster.

In KDE projects while making them Qt6-ready a set of commits with messages like “Use includes instead of forward decl where needed” were made, due to the new requirements by moc generated code with pointer types and properties. These would not have been needed with moc includes.

Enabling clang to warn about unused private fields

The clang compiler is capable to check and warn about unused private class members if it can see all class methods in the same compilation unit (GCC so far needs to catch up):

class Foo : public QObject {
    Q_OBJECT
    /* ... */
private:
    bool m_unusedFlag;
};

The above declaration will see a warning if the moc file is included with the source file having the definition of all (normal) non-inline methods:

/.../foo.h:17:10: warning: private field 'm_unusedFlag' is not used [-Wunused-private-field]
   bool m_unusedFlag;
        ^

But not if the moc file is compiled separately, as the compiler has to assume the other methods might use the member.

Better binary code, due to more in the compilation unit

A moc include into a source file provides the compiler with more material in the same compilation unit, which is said to be usable for some optimizations:

Indeed when building libraries in Release mode, so with some optimization flags enabled, it can be observed that size shrank by some thousandths for some. So at least size was optimized. For others though it grew a tiny bit, e.g. in the .text section with the code. It is assumed this is caused by the code duplications due to inlining. So there runtime is optimized at the cost of size, and one would have to trust the compiler for a sane trade-off, as done with all the other, normal code.

For another example, one of the commits to Qt’s own modules establishing moc includes for them reports in the commit message for the QtWidgets module:

A very simple way to save ~3KiB in .text[edit] size and 440b in data size on GCC 5.3 Linux AMD64 release builds.

So far it sounds like it is all advantages, so what about the disadvantages?

More manual code to maintain with explicit moc include statements

To have explicit include statements for each moc file covering a header (e.g. moc_foo.cpp for foo.h) means more code to manually maintain. Which is less comfortable.

Though the same is already the case for moc files covering source files (e.g. foo.moc for foo.cpp), those have to be included, given the class declarations they need are in that very source file. So doing the same also for the other type would feel not that strange.

The other manual effort needed is to ensure that any moc include is also done. At least with CMake’s automoc things will just silently work, any moc file not explicitly included is automatically included by the target’s mocs_compilation.cpp file. That one is currently always generated, built and linked to the target (TODO: file wish to CMake for a flag to have no mocs_compilation.cpp file).

One approach to enforce moc includes might be to add respective scripts as commit hooks, see. e.g. check-includemocs-hook.sh from KDAB’s KDToolBox.

No longer needed moc includes are also not critical with CMake’s automoc, an empty file will be generated and a warning added to the build log. So the developer can clean-up later when there is time.

So the cost is one include statement per moc-covered header and its occasional maintenance.

Automated moc file include statements addition, variant 6

There exist already a few scripts to scan sources and amend include statements for moc files where found missing, like:

Initially I was not aware of all. The ones tested (KDE’s, KDAB’s & Remy van Elst’s) missed to cover matching header files with the basename suffixed by “_p” (e.g. foo_p.h) to source files without that suffix (e.g. foo.cpp). So there is now a (working for what used for) draft of yet another script, addmocincludes. Oh dear 🙂

Suspicion substantiated: better use moc includes

As shown above, it looks that the use of explicit includes also for header moc files improves things for multiple stakeholders:

  • developers: gain from faster full & incremental builds, more sanity check
  • users: gain from runtime improvements
  • CI: gains from faster full builds
  • packagers: gain from faster full builds

All paid by the cost of one explicit include statement for each moc-covered header and its occasional maintenance. And in some cases a slightly bigger binary size.

Seems a good deal, no? So…

  1. pick of one the scripts above and have it add more explicit moc includes
  2. check for some now possible forward declarations
  3. look out for any newly discovered unused private members
  4. PROFIT!!! (enjoy the things gained long term by this one-time investment)
Update (Aug 14th):

To have the build system work along these ideas, two issues have now been filed with CMake’s issue tracker:

Sunday, 25 June 2023

This is the release schedule the release team agreed on

  https://community.kde.org/Schedules/KDE_Gear_23.08_Schedule

Dependency freeze is in less than 4 weeks (July 20) and feature freeze one
after that. Get your stuff ready!
 

Friday, 23 June 2023

Let’s go for my web review for the week 2023-25.


Celebrating 25 years of The KDE Free Qt Foundation | KDE.news

Tags: tech, kde, foss, community, licensing

Happy birthday the KDE Free Qt Foundation! It’s really nice to see it survived the test of time. It is for sure an essential tool of the KDE ecosystem. I wish there would be more such foundations around.

https://dot.kde.org/2023/06/21/celebrating-25-years-kde-free-qt-foundation


Reforming the free software message

Tags: tech, foss, criticism

Following up on his “The Free Software Foundation is dying” post, Drew DeVault has been working on the messaging part of his recommendations. The result is not bad at all!

https://drewdevault.com/2023/06/19/Reforming-the-free-software-message.html


We need more of Richard Stallman, not less

Tags: tech, foss, criticism

Despite the (sometimes valid) criticism floating around RMS and the FSF, we can’t deny RMS has been proven right more than once.

https://ploum.net/2023-06-19-more-rms.html


Raters helped train Google’s AI. But after speaking out, they were fired. - The Washington Post

Tags: tech, machine-learning, ai, gpt, google

Maybe it’s time to make so called “reinforcement learning from human feedback” actually humane? It’s not the first account along those lines in the industry.

https://www.washingtonpost.com/technology/2023/06/14/google-ai-bard-raters-chatbot-accuracy/


People Are Using AI to Automate Responses to Site That Pays Them to Train AI

Tags: tech, ai, machine-learning

Oh the bad feedback loop this introduces… this clearly poison the well of AI training when it goes through such platforms.

https://futurism.com/the-byte/people-automating-responses-train-ai


Most tech content is bullshit

Tags: tech, programming, craftsmanship

We went from quality to quantity it seems. We also have whole swats of developers who are just consuming content without critical thinking and it’s a problem. The conclusion says it all: “Don’t consume. Create. Ask questions. Stay curious.”

https://www.aleksandra.codes/tech-content-consumer


OpenLLM: An open platform for operating large language models (LLMs) in production

Tags: tech, ai, machine-learning, gpt, foss, self-hosting

Looks like an interesting tool to run LLMs on your own hardware.

https://github.com/bentoml/OpenLLM


Infinigen

Tags: tech, 3d

Looks like a really nifty 3D procedural generator. I wish I’d have an excuse to use it on a project.

https://infinigen.org/


Linux Namespaces Are a Poor Man’s Plan 9 Namespaces · Yotam’s blog

Tags: tech, unix, plan9, linux, history

Sometimes I really regret Plan 9 didn’t take off. So many good ideas and designs in there.

https://yotam.net/posts/linux-namespaces-are-a-poor-mans-plan9-namespaces/


Squeezing a Little More Performance Out of Bytecode Interpreters · Stefan-Marr.de

Tags: tech, machine-learning, bytecode, performance, optimization

Interesting research turning to genetic algorithms to optimize bytecode handler dispatchers.

https://stefan-marr.de/2023/06/squeezing-a-little-more-performance-out-of-bytecode-interpreters/


Copy-and-Patch Compilation

Tags: tech, compiler, performance

This compilation technique brings very interesting results. Hopefully should find its way in some JIT compilers.

https://fredrikbk.com/publications/copy-and-patch.pdf


Why Static Typing Came Back • Richard Feldman • GOTO 2022 - YouTube

Tags: tech, programming, language, type-systems

Interesting point of view on why static typing seems to make a come back right now and why it’s likely to continue. I think a few of the arguments in here are wrongly framed (like some of the benefits of using an interpreter rather than a compiler are attributed to dynamic typing while it’s rather orthogonal) but a large part of the analysis seems valid to me.

https://www.youtube.com/watch?v=Tml94je2edk


Compiling typed Python | Max Bernstein

Tags: tech, python, compiler, type-systems, performance

Unsurprisingly, it’s not as simple as it sounds. Type hints in Python can be used for various reasons but performances is rarely the main motives. It’d need other adjustments to the runtime. People are working on it, and this article is an interesting dive on how things work under the hood.

https://bernsteinbear.com//blog/typed-python/


The best Python feature you cannot use

Tags: tech, python, tests, safety

Kind of sad to see asserts misused so much in the Python community. Still that’s a good lesson for everyone: when using an assert, expect it won’t get executed when in production.

https://www.bitecode.dev/p/the-best-python-feature-you-cannot


Designing Pythonic library APIs

Tags: tech, design, api, python

Good set of advises for Python APIs. Some applies more generally though.

https://benhoyt.com/writings/python-api-design/


Graphics for JVM @ tonsky.me

Tags: tech, java, graphics

Is the graphics community warming up to the JVM? Or is it the other way around? Let’s see if it makes progress in any case.

https://tonsky.me/blog/skija/


Rust vs C++ Formatting | Barry’s C++ Blog

Tags: tech, rust, c++, programming, type-systems

Interesting deep dive in Rust and C++23 string formatting features. This shows the differences quite well. It also does a good job at highlighting the pros and cons for each approach.

https://brevzin.github.io/c++/2023/01/02/rust-cpp-format/


std::shared_ptr is an anti-pattern | Dmitry Danilov

Tags: tech, c++, memory

The title of the post is not the best. Still it nicely lists and explains common mistakes around the use of std::shared_ptr.

https://ddanilov.me/shared-ptr-is-evil/


Style your RSS feed

Tags: tech, blog, rss, xslt

Definitely a neat trick to have a slick RSS feed with a nice experience from the browser.

https://darekkay.com/blog/rss-styling/


Plain Text Journaling · peppe.rs

Tags: tech, productivity, organization, vim

Neat little journaling system using vim. I can hear Emacs users cringe from here though.

https://peppe.rs/posts/plain_text_journaling/


I Don’t Need Your Query Language

Tags: tech, databases, sql

I don’t understand the SQL shaming I see in some circles. It’s clearly based on dubious arguments.

https://antonz.org/fancy-ql/


🧠 Cognitive Load Developer’s Handbook

Tags: tech, complexity, programming

Neat little resource. We indeed should pay more attention to complexity across our industry.

https://github.com/zakirullin/cognitive-load


Ikea-Oriented Development

Tags: tech, programming, complexity, design, interoperability

Interesting parallel taken with IKEA. Some of their principles translate to nice traits for software as well.

https://taylor.town/ikea-oriented-development


Flexible systems | Organizing Chaos

Tags: tech, organization, system, change

Definitely this, what matters most is being able to change previous decisions. In comparison each decision itself is less important.

https://jordankaye.dev/posts/flexible-systems/


The Shape of Code » Software effort estimation is mostly fake research

Tags: tech, estimates, research

We got a problem with research around software estimates. This won’t help us get better at it as an industry…

https://shape-of-code.com/2021/01/17/software-effort-estimation-is-mostly-fake-research/


The limitations of Scrum framing and what you might use instead

Tags: tech, agile, scrum, project-management, product-management

Wording matters, and framing things differently can free teams from the Scrum limiting views. This is required to find a path towards improvements.

https://jchyip.medium.com/the-limitations-of-scrum-framing-and-what-you-might-use-instead-a325d3b8b414


Maps Distort How We See the World - by Tomas Pueyo

Tags: geography, map

Great article. We know that the projections we use can’t give a proper picture of the world. We often don’t realize by how much it distort our views and what we miss. This is a good summary of the various biases in our maps.

https://unchartedterritories.tomaspueyo.com/p/maps-distort-how-we-see-the-world



Bye for now!

Wednesday, 21 June 2023

Wait a minute…

Having come across sources using include statements for some Qt module headers (like #include <QtDBus>), memories arose about a check from the static analyzer tool krazy as once run conveniently on KDE’s former ebn.kde.org site. That check, called includes, poked one not to use Qt module headers. Due to resulting in the inclusion of all the headers of those modules, and then again that of the other Qt modules used by the module. Which them meant more stuff to process by the compiler for compilation units with such module header includes.

So is that perhaps in 2023 no longer a real-world noticeable issue? A first look at some preprocessor outputs (with Qt5) for a single line file with just an include statement hinted though it might still be true:

foo.cpp: #include <QtDBus>foo.cpp.i: 137477 lines
foo.cpp: #include <QDBusReply>foo.cpp.i: 86615 lines

So 50862 more code lines of mainly declarations and inline methods, where a good part might not be needed at all by other code in a file including the header, yet is processed each time. And if such includes are placed in headers, happening for a lot of compilation units. Given most normal source files are shorter, it seemed like as result this difference might still be noticeable given that order of magnitude in the extreme example above..

Wait some minutes less now

The KDE Frameworks module NetworkManagerQt was found to use quite a lot of QtDBus module header includes. While overall following mostly the include-only-what-you-need-and-forward-declare-otherwise mantra. Possibly those includes have been a result of tools generating code and using the module headers to speed up initial development experience.

A patch to replace those QtDBus module header includes with includes of headers as just needed for the classes & namespace used was done. It turned out that the number of additional include statements needed afterwards was rather small, so no bigger costs there.

For a simple test on the real world effects, an otherwise idle developer system, with hot cache for the source files by previous runs, with SSD and old i5-2520M 2.5 GHz CPU, was used. For both variants the build dir would be cleaned by make clean and then a single job make run started, timed with the time tool, by time make. The results were this (repeated runs hinted those numbers are representative):

#include <QtDBus>#include <[headerasneeded]>
real (wall clock)18m51,032s14m6,925s
user17m58,326s13m22,964s
sys1m54,234s1m26,826s

So an overall build time reduction by around a 1/4 for a clean(ed) build.

Incremental builds during development should also gain, but not measured, just assumed. 🙂

Wait* on the code, to not wait on the build

(*as in waiter)

So in the spirit of the old Krazy includes check, consider to take a look at your codebase if not some Qt module header includes (QtCore, QtDBus, QtQml, QtGui, QtWidgets, QtNetwork, …) have sneaked in which might be simple to replace by “normal” includes.

Note: there is at least one tricky include with QtConcurrent, as that module shares the name with the main C++ namespace. So one might have used #include <QtConcurrent>, due to used-to Qt patterns and because the API documentation also tells to do. Just, that include gets one the module header, which then also pulls in #include <QtCore> with all its headers. Looking at the include directory of that module, one can find dedicated headers to use instead, like QtConcurrentRun. While many codebases e.g. in KDE projects rely on those, they still need to be also officially documented (QTBUG-114663).

In case one would like some more modern automation tool to check for the use of Qt module header includes, take a look at the current work to add a check to the static code analyzer Clazy.

PS: For those into riding their office chair into sword duels… you should have let me win more often? 😉

Monday, 19 June 2023

Hello again!

In my last post, I talked about starting off my open-source journey with KDE's Kalendar - specifically, adding support for calendar invitations within Kalendar. Three weeks in, here are some updates on the project:

  • Calendar now has support for Free/Busy information retrieval and publishing.

  • Additionally, you can configure the number of days of info to publish (or email to select contacts), and whether to upload it automatically and at what intervals.

  • Note that Kalendar does not yet allow you to make use of others' Free/Busy information while scheduling a meeting - more on that in the coming weeks!

Now, what is free/busy information, and why should you care? Essentially, it's a little database keeping track of the time slots for which your calendar is marked free or busy. This information (should you choose to share it), which does not include any details about why any slots are busy, can help meeting organizers keep track of when participants are available, and thus when a meeting might be scheduled. If you use Kalendar, meeting management should get a lot more doable from within the app once this is fully implemented :)

Oh and, here's a quick look at what the changes look like:

Stay tuned to this blog for more updates!

People are often asking the same questions again and again about some of my projects, so it might be a good opportunity to write a small FAQ.

If you get redirected here, don’t take it personally; I am getting asked these questions very often, and I feel people often misunderstand how open-source projects work.

Why does X not have feature Y?

The most likely reason is that it still needs to be implemented. It doesn’t mean that I or other maintainers are against this feature. It is just that X is a purely non-commercial project, and I and others are currently working on it during our free time. Unfortunately, Free time is a very limited and precious resource. Between our day jobs or university projects, sleeping, eating, and other social activities, little time and energy is left.

We definitively might implement the feature in the future, but the best way to ensure this gets implemented promptly is to get involved and implement it yourself. Feel free to join our development channel beforehand and confirm that the feature is something we would like to have in the application.

We are happy to guide you to make the onboarding experience as good as possible and to help you familiarize yourself with the code base. Getting involved with open-source projects is also an excellent opportunity to learn how to program. Check out the Google Summer of Code, Outreachy, or Season of KDE for special mentoring programs, but getting involved outside these programs is also possible. On a personal note, I learned most of my programming skills by contributing to KDE, so I am very thankful for that.

When will you implement feature Y? Is Y on your roadmap?

Similarly to the previous question, X is a non-commercial project implemented during my and others’ free time. We can’t say precisely when we will be done with a particular feature as it depends on many factors: how much energy do we currently have to work on this project after our day job/university projects, are there more pressing issues, are there a technical blocker which needs to be solved first, it is fun to implement…

Again the best way to speed this up is to get involved.

What is your roadmap?

We are a non-commercial project which is purely volunteer based. We are just a bunch of developers and designers; we do not have managers, stakeholders, or clients influencing our work directly by setting deadlines or by asking and paying for specific features. Part of the reason we enjoy working on this project is that we have a lot of freedom in terms of what we want to work on and are also very flexible, allowing us to switch to a different task whenever we want.

Again the best way to influence the direction of this project is to get involved.

Unifying the KRunner sorting mechanisms for Plasma6 & further plans

In Plasma5, we had different sorting implementations for KRunner and Kicker. This had historical reasons, because Kicker only used a subset of the available KRunner plugins. Due to the increased reliability, we decided to allow all available plugins to be loaded. However, the model still hard-coded the order in which the categories are displayed. This was reported in this bug which received numerous duplicates.

To address this concern, I focused on refactoring and cleaning up KRunner as part of KDE Frameworks 6. Among the significant architectural changes was the integration of KRunner’s model responsible for sorting into the KRunner framework itself. This integration enabled easier code sharing and simplified code maintenance. Consequently, the custom sorting logic previously present in Kicker could be removed.

Further plans

Now you know some of the improvements that have been done, but more interesting might be the future plans! While the sorting in KRunner was in lots of regards better than the one from Kicker, it still has some flaws. For instance, tweaking the order of results from a plugin developer’s perspective proved challenging, since rearranging categories could occur unintentionally. Also, KRunner implements logic to prioritize often launched results. In practice, this did not work quite well, because it only changed one of two sorting factors that are basically the same (sounds messy, I know :D).

The plan is to have two separate sorting values: One for the categories and one for the results within a category. This allows KRunner to more intelligently learn which categories you use more the most and prioritize them for further queries.

Another feature request to configure the sorting of plugins. With the described change, this is far easier to implement. Some of the visuals were already discussed at the Plasma sprint last month.

Stay tuned for updates!

Friday, 16 June 2023

There’s no better measure of success than having a diminutive eight-year-old girl demand to know the name of the painting program she has been using for the last 20 minutes.

Let’s go for my web review for the week 2023-24.


Artilect needs some help

Tags: tech, community

You might remember we were hosted in Toulouse for the KDEPIM Sprint this year. Very nice venue, they do other things locally of course. They need to raise some money to get to the next level. It’d be nice to see them receive lots of love. Head to their fundraising page! (in french though)

https://www.helloasso.com/associations/artilect/collectes/artilect-fablab


‘No regrets,’ says Edward Snowden, after 10 years in exile | Edward Snowden | The Guardian

Tags: tech, surveillance

Things improved a bit… they also got worse in a way. This stays an ongoing fight for the years to come.

https://www.theguardian.com/us-news/2023/jun/08/no-regrets-says-edward-snowden-after-10-years-in-exile


Reddit’s users and moderators are revolting against its CEO - The Verge

Tags: tech, reddit, social-media

Another centralized tool for communication going down the drain. I wonder what the IPO will look like in this case.

https://www.theverge.com/2023/6/10/23756476/reddit-protest-api-changes-apollo-third-party-apps


What Reddit Got Wrong | Electronic Frontier Foundation

Tags: tech, reddit, social-media

Excellent summary of the situation regarding the Reddit debacle.

https://www.eff.org/deeplinks/2023/06/what-reddit-got-wrong


Killing Community @ marginalia.nu

Tags: tech, business, social-media, community

Interesting and provoking thought… Indeed it’s hard to build communities while also aiming for rapid and constant growth. There’s no chance of having communities properly stabilize which leads to the tribalism and bad behavior we see on social media.

https://www.marginalia.nu/log/82_killing_community/


Every Signature is Broken: On the Insecurity of Microsoft Office’s OOXML Signatures | USENIX

Tags: tech, cryptography, security

Signature of digital documents is definitely not as safe as we would like. All the serious formats have known flaws at this point.

https://www.usenix.org/conference/usenixsecurity23/presentation/rohlmann


Stack Overflow Developer Survey 2023

Tags: tech

The results of this annual survey are available. A few interesting insights in there even though I find some of the categorization weird. For instance why splitting so much in details the various Linux flavors? If they didn’t it’d show them as the most popular option for professional use. There are a few other cases where one might want to aggregate by hand or split in several groups among questions.

Here are some of the takeaways I found:

  • it’s interesting to see PostgreSQL, MySQL and SQLite reigning supreme in the database space on several metrics;
  • there’s clearly something going on with Rust which is once again among the favorites;
  • also notable is the popularity of the Phoenix framework which is probably driving the Elixir adoption;
  • I find interesting and ironic the raise of Markdown for sharing information, it feels like it could become the de facto standard in some organizations while staying in the shadow of Confluence and Notion;
  • a big surprise to me is that it feels like Matrix has potential to make a dent into the communication tools space for the coming years (there are early signals in the survey in my opinion, we’ll see if that gets confirmed);
  • it looks like hybrid and remote work are here to stay, some people went back to being fully in-person but not that many.

It’s also the first time they integrate the use from AI tools but that doesn’t give any surprising or interesting insight yet. It just confirms the hype and the domination of a couple of giant players.

https://survey.stackoverflow.co/2023/


LLMs are good at playing you

Tags: tech, ai, gpt

Nice piece which shows how easy it is to get such models to produce nonsense.

https://lcamtuf.substack.com/p/llms-are-better-than-you-think-at


Language Model Sketchbook, or Why I Hate Chatbots

Tags: tech, ai, gpt, ux

Interesting ideas for using large language models. There is a world beyond the chatbot interface and it might bring more value to users and avoid some of the pitfalls of anthropomorphisation.

https://maggieappleton.com/lm-sketchbook


An America-less Internet | NthBrock

Tags: tech, internet, distributed, dns, geography

Interesting experiment… with surprising results in places. What stays available or not is not necessarily what one would think. It’s not that easy to be flexible and available across regions.

https://www.nthbrock.com/posts/americaless-internet/


How much memory is needed to run 1M Erlang processes? - Hauleth

Tags: tech, multithreading, performance, memory, benchmarking, erlang

Deep dive on a proper benchmarking and implementation for 1M task on the Erlang runtime. Clearly the previous benchmark had room for improvements.

https://hauleth.dev/post/beam-process-memory-usage/


Tags: tech, java, dependencies, supply-chain

Very interesting study on dependencies. This is specific to the Maven ecosystem so too early to generalize the findings to other similar ecosystems. This indicates at least the difficulties of managing dependencies, especially the transitive ones. Also tries to define the “dependencies bloat” problem.

https://link.springer.com/article/10.1007/s10664-020-09914-8


60 terrible tips for a C++ developer

Tags: tech, programming, c++

Funny list of anti-patterns. Not all of it is C++ specific in there, but some are good reminders of the hidden traps in the language.

https://pvs-studio.com/en/blog/posts/cpp/1053/


AsyncIO

Tags: tech, python, asynchronous, multithreading

A piece criticizing the asyncio approach in Python (especially considering the performance tradeoffs in this language). Also provides viable alternatives.

https://charlesleifer.com/blog/asyncio/


Describing Descriptors | Pydon’t 🐍 | Mathspp

Tags: tech, python, metaprogramming

Interesting feature from the Python language. Lots of features are actually built on top of it.

https://mathspp.com/blog/pydonts/describing-descriptors


GitHub - imsnif/diskonaut: Terminal disk space navigator 🔭

Tags: tech, tools, command-line

Might come in handy when Filelight is not available, I could see myself using this over SSH connections.

https://github.com/imsnif/diskonaut


CLI tool to insert spacers in command output to provide visual markers of when things happened

Tags: tech, tools, command-line, logging

Interesting little tool, can come in handy.

https://github.com/samwho/spacer


Some tests are stronger than others • Buttondown

Tags: tech, tests

Interesting way to reason about tests and classify them. I think it can be more useful than the strict “unit” vs “integration” that is way too widespread.

https://buttondown.email/hillelwayne/archive/some-tests-are-stronger-than-others/


ignore the code: Anti-Personas

Tags: tech, product-management, ux

Interesting idea, personas help with producing features, something is needed to prevent features we don’t wante.

http://ignorethecode.net/blog/2023/06/13/anti_personas/


Jim Highsmith, Co-creator of the Agile Manifesto, Storyteller, Adventurer - YouTube

Tags: tech, agile, values

The interview is overall very interesting (I advise listening to it in full). It’s nice to have such an historical perspective. At 15:00 there’s a question which prompt a very important explanation of why the word “over” was chosen and repeated in the agile manifesto. Unfortunately it’s been often misinterpreted…

https://www.youtube.com/watch?v=9VW8YNSVYX4&t=900s


Removing uncertainty: the tip of the iceberg

Tags: tech, risk, project-management, product-management, deployment, architecture

Good piece on how to reduce uncertainty before something is built and ready to be in front of users. It starts with prototyping but goes all the way to feature flags and deployment

https://theengineeringmanager.substack.com/p/removing-uncertainty-the-tip-of-the


Tindall On Software Delays

Tags: tech, project-management, product-management, history

Very interesting! This is really old wisdom which should be more widespread. A few words of caution in there for everyone, me included.

https://two-wrongs.com/tindall-on-software-delays.html


Speed matters: Why working quickly is more important than it seems « the jsomers.net blog

Tags: productivity

Interesting point of view… it’s also about the perceived cost of a task. Of course this means one needs to get faster through practice, it’s not about delivering botched work.

https://jsomers.net/blog/speed-matters


Johnny•Decimal

Tags: tech, productivity, organization

Interesting way to organize your data. This gives a library feel for sure. At least it makes me curious.

https://johnnydecimal.com/


UNIHIKER - A single board computer brings you brand new experience.

Tags: tech, hardware, embedded

Looks like an interesting device to tinker with.

https://www.unihiker.com/



Bye for now!

Thursday, 15 June 2023

Bundle Creator


Recap

Welcome back! Last time, I successfully completed the development of the Bundle Creator up to the Resource Chooser page. This page now allows us to easily select resource items by applying filters based on tags or names. I’ve introduced some UI improvements, including the ability to click-to-select, the addition of a convenient Remove Selected button and the introduction of a visually appealing grid view to replace the traditional list view. These enhancements enhance the overall user experience and provide a more streamlined resource selection process.

The Bundle Creator Wizard

As mentioned in previous blog posts, the Bundle Creator consists of four pages: the Resource Chooser, Tag Chooser, Bundle Details, and Save to pages. These pages can be seen in the wizard’s side widget, and users can navigate between them using the Next and Back buttons. The Tag Chooser page retains a similar design to the Embed Tags page from the previous version of the bundle creator. It offers a familiar interface for users to select and embed tags to their new bundle. Similarly, the Bundle Details page maintains consistency with the previous bundle creator, where one can fill out the bundle name, author, website etc.

The inclusion of the Save to Page adds a crucial final step to the bundle creation process. It provides a summary of the bundle details, which includes the number of selected resource items per resource type, and the tags chosen for embedding. This comprehensive summary allows users to review and confirm their bundle’s content before finalizing the creation process.

By dividing the bundle creation process into these distinct and user-friendly pages, particularly for beginners, the Bundle Creator offers a streamlined and intuitive experience. Users can efficiently navigate through each step, making informed decisions and customizing their bundles according to their specific needs.

Bundle Creator

I have added a small tool button that allows switching between grid view and list view in both the resource manager and bundle creator, providing convenience to the users. Additionally, I have made the icons in the bundle creator more consistent.

Bundle Creator

Merge Request

My merge request can be viewed here.

Plans ahead

In the upcoming weeks, I would be working on adding the editing bundles feature, as well as improving the Choose Tags section. This requires some UI related feedback, and if you’re interested to help out, please feel free to drop a comment on this post I created on Krita Artists Forum!