Recently, after refactoring some Rust code, I noticed that it had suddenly become four times slower. However, the strange part is that I didn’t even touch the part of the code that became slower. Furthermore, it was still slower after commenting out the changes. Curious, I decided to investigate further.
The first step was to use git diff to display all changes since the previous commit, which was normal speed. Then I started removing them one by one, no matter how inconsequential, and testing to see if it was still slow after the change.
Adding the print statement causes the code to go from 0.16 seconds to 1.7 seconds, an 11x slowdown (in release mode). Then, I posted it in the rustc IRC channel, where eddyb and bluss suggested a workaround and explained what was going on.
The fix was to the change the print line to the following, which does indeed fix the slowdown.
If you use GNOME or Ubuntu, then GNOME Disks is probably what you rely on if you ever need to do any disk management operations, so it’s a relatively important piece of software for GNOME and Ubuntu users. Now if you’re a command line geek, you might handle disk management via command line, and that’s fine, but most users don’t know how to do that. Or if you’re living in the past like Ubuntu and not yet using Wayland, you might prefer GParted (which does not work under Wayland because it requires root permissions, while we intentionally will not allow applications to run as root in Wayland ). But for anyone else, you’re probably using GNOME Disks. So it would be good for it to work reliably, and for it to be relatively free of bugs.
The GNOME desktop environment is loved by many, but it allows for very little out-of-the-box customisation. However, you can extend the features of the desktop by installing third-party extensions which help to fix any weird quirks you might have observed or change the behaviour of your desktop outright.
I got to completely geek out when Daniel Matte wrote up the things he found about Andromeda while looking through some Google source code earlier this week. It reinforced a lot of the things I thought when I first looked through all the code in August 2016, caught a lot more things that I overlooked, and examined the new code. I think Matte's assessments are pretty close to the mark here. Not because they confirmed some of my original thoughts, but because it points out things I got wrong. Or at least I think I got them wrong. Everything about Andromeda or Fuchsia is still just educated guessing.