It will be Kai over and yeah, Kai, the stage is yours. Thank you.
Let me get the secret item I just stashed here. Anyone know what this is?
It comes with this nice USB-Y cable.
Yes. So you totally blew the cover. I even prepared a slide.
Like, does this help? So yes.
Yeah, that's like a coaster for your beer.
So yeah, this is...
Maybe. maybe um so yeah this is like an optical external drive so raise your
hands who has used an optical drive or who still has an optical drive in their like daily computer.
Yeah like you not the one that's sitting in the closet for 10 years but the
one that you actually use does it still have an optical drive one hand so there's
like two or three hands who Who has used it within the last two years or something?
Oh my goodness, that's like totally different than I expected.
But anyway, so this talk is about the story of how this device let me unlock
a massive performance boost in our SOLID framework.
SOLID is our multi-platform cross-platform device abstraction framework and
it enumerates batteries and storage devices for the most part.
It has backends for F-stop and U-disk and flip iMobile device even.
So even if you plug in your iPhone,
your battery monitor shows the battery percentage and that sort of thing.
So it's very modular and cross-platform and it's used in a lot of places like
device notifier where you see your external storage media, the battery monitor,
the places panel in Dolphin where you have your bookmarks and the devices.
For file previews, we check if the partition is encrypted and then don't store the cache and whatnot.
So you probably, we can all agree that improving solid helps in a lot of places.
So the UDISC's backend that talks to UDISC, which is this Linux service for
enumerating storage devices.
I found a couple of issues with it. So the UDISC backend enumerates all block
devices of which there can be lots.
For example, snap is very notorious for creating 500,000 loop device mounts.
So I even have like special cases for like, okay, if this is a snap thing,
then ignore it just to make it faster.
And then for every device that it finds, it creates a device object and every
device object then queries all of those properties from UDISCs and does it all
with blocking synchronous DBUS cores.
So it's not very efficient so the
question is can we do better yes of course otherwise i
wouldn't be giving this talk first of all don't never
ever ever ever ever use qdbus interface
it's this innocent looking class that
in its constructor will do a blocking
introspect call on the service so if
you have one per device you can probably agree that it
all adds up a lot and most of
the time there isn't even a reason to do that because either you
know the interface so you can use add dbus interface
provide an xml description and have a compile time
generated header file so no introspection needed or you
do a blind call with like qdbus create method call you pass a string but there's
never a reason to use qdbus interface so we probably should have a ci check
that if you use qdbus interface it just blocks it and i will come knocking down
your door so can we do better Of course,
we can use DBus Object Manager in Solid.
So Object Manager is this API which did not exist back when Solid was originally
written. That's why it's not using it.
And that lets us get all the properties at once.
So I even have this merge request there. So if you want to give it a try,
if you use weird, obscure media, then you can check out this merge request.
So we use DBus Object Manager. We get all of the properties at once. Job done.
Or is it? Optical media is scary, right? A USB stick, you plug it in,
it comes up, you unplug it, goes away.
Optical media, it's always this drive which has media in it.
So we have to like monitor the drive and the media inside of it.
And even the drive can go away. And then there's like audio CDs. So you plug it in.
Solid says, oh, there's an audio CD, going to show it. You have data CD, CD comes.
Solid is like, I don't know. then the file system appears and you have a data CD.
And then there's mix mode Cs, you plug it in, Solid is like, oh, this is an audio CD.
And then Udysseus is like, yeah, but it has a file system too.
And then Solid is like, oh, it's here again.
And then Places panel is like, I have two devices now, what's going on?
And then it just explodes. So.
The other month on Matrix I asked, like, anybody got a spare DVD drive?
Because I don't have one. I haven't had one for, I don't know,
15 years. One day my neighbor even knocked.
So he's also in IT. He was like, I got some scans from my doctors.
Like, do you have a CD drive? I was like, no, sorry.
I asked half the neighborhood and I don't have a CD drive.
So, yeah, I got this generous donation from Martin R. on the KD Neon channel, I think it was.
And he said, yeah, you know, I have this lying around. you want to have
it and was like yeah sure it's nice uh how much do
you get for like postage and he was like ah it's fine i've
always wanted to contribute to kd so he just sent it to
me via mail for like six seven years or something and
now i have this device and i suddenly could like reproduce
all the weird issues that people had with my merch request because now
i actually have this um device so yeah
i can test all of those weird use cases now but before that
i actually want to write lots of unit tests first for solid so
if anyone knows if there's like a equivalent to umoc
dev which lets you simulate u dev devices
for udisk so i don't have to write a bunch
of divas mock call that would be really nice because then i can actually test
my change that automated before i actually merge because it's been ready for
five or six years i've tried to do object manager port but always i said okay
this optical drive stuff it's scary i don't want to merge it because it might
like explode all over the place.
So yeah, this goes to show that contributing is more than just code.
We have people doing artwork, translations, promo work, IT infrastructure,
people hosting calls and putting around microphones and much more.
So yeah, it's not just about code, but like every little contribution counts. So thank you.