News for hackers. Stuff that matters.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @12:43PM (#36003964)
I mean, I get it. But shaving 4.5ms does seem to fall into the realm of not most peoples problems?

Note that I want to stress that that is no reason for some folks to stop focusing on it. And kudos on the improvement. Criticism, if any, here is that statistics once again rears its head to make something feel bigger by using a percent.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by nextaccountic on Friday May 19, 2023 @01:08PM (#36004329)
> I mean, I get it. But shaving 4.5ms does seem to fall into the realm of not most peoples problems?

If whoever is fixing this depend on quickly launching instances in Firecracker, it's their problem. And that's how open source is usually done

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @01:11PM (#36004377)
Sorta. They have to rely on this on a repeated basis such that it matters. And there, if startup time is still 10x this, roughly, why push for solutions that require that many kernel startups?
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by vasco on Friday May 19, 2023 @01:46PM (#36004777)
Why do anything, we're all going to die!!

Super fast boots of containers is a good effort, would be cool to be as fast as spawning a process or a thread!

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @02:02PM (#36004992)
That is silly. I already said I do not intend this as a criticism of the folks working on it. Kudos on the improvement.

That said... for most people, you are better off learning to use threads or processes. It is almost certainly less effort than spinning up a VM. Not to mention everything else you will, by necessity, have to do if you are using VMs for everything. Unless you find ways to do shared network connections across VMs and such, but... I'm curious how we can make things closer to threads, without eventually bringing all of the dangers of threads along with it?

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by rcoveson on Friday May 19, 2023 @03:05PM (#36005668)
Why make "for most people" points when we're already talking about FreeBSD?

There's a sort of uni-/light-kernel race quietly happening right now since the industry doesn't really fully trust process isolation within an OS for running completely untrusted code. At least not as much as it trusts VT-X/AMD-V. In that race, kernel startup time is just like JVM startup time, or Julia startup time, or Python startup time, all of which are things that people work on shaving milliseconds from.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @03:14PM (#36005753)
Ouch. That feels even harsher to the idea than what I'm saying. :D

To your point, my "for most people" is aimed at this forum. Not the folks doing the work. Is incredibly cool that the folks doing this are also on the forum, but I think it is safe to say they are not most of the folks on here. That not the case?

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by rcoveson on Friday May 19, 2023 @04:49PM (#36006705)
Say the post had been "How Netflix uses FreeBSD to achieve network latencies less than 10 microseconds" or something. How helpful would it be to comment about how "for most people" this doesn't matter?

Did anybody who read the tweet think it mattered to them when it didn't? It mentions Firecracker explicitly. How many people on HN do you think upvote this because they themselves are running FreeBSD on Firecracker, versus the number who upvoted because it's just interesting in and of itself?

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @09:15PM (#36008534)
Maybe? Having worked in way too many teams that were convinced we had to aim at some crazy tech because someone else saw "50% increase in throughput" on some tech stack; I am happy to be the one saying to keep perspective.

Though, I will note that you picked a framing with absolute timing here. That is the root criticism here. If the headline would be "team saved 2ms off 28ms startup routine," it would still be neat and worth talking about. Would probably not have impressed as many folks, though. After all, if they save 1% off training time on a standard ML workload, that is way way bigger. Heck, .07% is probably more time.

I'm reminded of a fun discussion from a gamedev, I think it was Jonathan Blow, on how they thought they were smarter than the ID folks because they found that they were not using hashes on some asset storage. He mused that whether or not he was smarter was not at all relevant to that, as it just didn't matter. And you could even make some argument that not building the extra stuff to make sure the faster way worked was the wiser choice.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by vasco on Saturday May 20, 2023 @04:45AM (#36010331)
If we didn't have you here we might have done the terrible mistake of thinking this was interesting. I'm so glad you were here to show us how useless this effort is, protecting us from wasting our time, protecting us from our lack of judgment. Thank you so much for your service and foresight.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by nextaccountic on Friday May 19, 2023 @10:36PM (#36008901)
Isn't fast startup the point of firecracker? It's supposed to scale down to zero when there are no users, and quickly ramp up when needed.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Saturday May 20, 2023 @01:45AM (#36009653)
I mean... sorta? Yes, it is the point. But, the goal is to make it so that you can do this scale up/down at the VM level. We have been able to do this at a thread or even process level for a long long time, at this point.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by lacrosse_tannin on Friday May 19, 2023 @06:42PM (#36007620)
why not boot a good os in firecracker instead?
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by maccard on Friday May 19, 2023 @01:47PM (#36004796)
4.5ms on what hardware, in what scenario? Would I like to save 5ms off the startup time of my VMs? You betcha. Does that 5ms turn into 200ms on a low power device? Probably
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @01:54PM (#36004877)
I'm not even clear that I care on my VMs. I don't start up enough for that to save me more than... a second a month or so? Maybe. Probably not even.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by maccard on Friday May 19, 2023 @03:24PM (#36005849)
Great! Then this doesn't affect you!
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @03:31PM (#36005917)
Right, but again pointing this at most people on this forum, that answer is probably the same. Very few of us are in a situation where this can save seconds a year, much less seconds a month.

For the folks this could potentially save time, I'm curious if it is better than taking an alternative route. Would be delighted to see an analysis showing impact.

And again, kudos to the folks for possibly speeding this up. I'm assuming qsort or some such will be faster, but that isn't a given. For that matter, if it is being sorted so that searches are faster later, than the number of searches should be considered, as you could probably switch out to sentinel scanning to save the sort time, and then you are down to how many scans you are doing times the number of elements you are looking against.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by daneel_w on Friday May 19, 2023 @03:54PM (#36006127)
How would you even discern this delay from all the other delays happening before you're done booting, when there are so many other natural variances of a couple of milliseconds here and there? Every "on metal" boot is unique, no two are exactly as fast, and certainly never within 1.98 milliseconds of eachother even in the case of a VM with lots of spare resources on the host. You're painting a too pretty picture of this.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by aidenn0 on Friday May 19, 2023 @01:56PM (#36004910)
My math says ~2ms (28ms*0.07 = 1.96ms)? Still, if it mattered to get it down to 28ms, it might matter to get it down to 26ms...
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @02:04PM (#36005010)
Agreed, but my math also says that if this is your pain point, you'd save even more time by not firing off more VMs? That is, skip the startup time entirely by just not doing it that often.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by aidenn0 on Friday May 19, 2023 @06:44PM (#36007645)
I don't startup VMs multiple times per hour, much less per minute, so I don't assume to know what tradeoffs the people using firecracker are making when deciding how often to startup VMs.
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @09:18PM (#36008555)
Fair. I still feel fine pushing back on this. The amount of other resources getting wasted to support this sort of workload is kind of easy to imagine.

I will put back the perspective that they were not hunting for 2ms increases. They were originally chopping off at seconds on startup. The progress they made is laudable. And how they found it and acted on it is great.

Re:FreeBSD spends 7% of its boot time running a bubblesort o... by MuffinFlavored on Friday May 19, 2023 @02:07PM (#36005039)
if 4.5ms is 7%, the entire boot time is 64ms?
Re:FreeBSD spends 7% of its boot time running a bubblesort o... by taeric on Friday May 19, 2023 @02:22PM (#36005179)
Ha, I thought I saw 4.5ms from another post. Not sure where I got that number. :(

Realizing this is why someone said the number was more like 2ms. I don't think that changes much of my view here. Again, kudos on making it faster, if they do.