Live data from Hacker News

Why can't computers boot instantly? (2013)

superuser.com

161–167 of 167 posts

Re: Why can't computers boot instantly? (2013)

#161

Earlier quoted context omitted.

Even ‘perf stat libreoffice ./somedocument.odt’ give an IPC of almost 2, and that's hardly a well-tuned computational workload. > And mostly software doesn't utilize multiple cores well. Most software sucks, that's the point of this whole conversation.

Valid correction, seems I was out of date, let's say 2 or below today. (I got 1.3-1.7 with a few libreoffice startup & command-line conversion experiments). However during the boot process I think the IPC will be notably less, because there will be periods of waiting for disk IO and hardware initialization waits. To zoom out, there are two dimensions here - it's good for software to run at a good IPC, but even better…

Sure, I think the point of measuring CPU speed is not to say that it suffices for a fast boot, but to say that whatever it takes to boot, the CPU should not be a limiting factor.

When I think of all the things necessary to booting; discovering connected devices, loading drivers, setting up memory and permissions, loading filesystem data, starting up the graphics hardware, ... I struggle to think of many things where ‘a few milliseconds’ is not plenty of time. For sure, you might have electrical limitations, spinning disks might take multiple milliseconds, and loading dozens of megabytes of data is not instantaneous, but, really, you've got 16 whole milliseconds in a frame at 60Hz! Is that so much to ask for?

Re: Why can't computers boot instantly? (2013)

#162
post #97

All of the answers here are missing something. In the old days, the OS was often on a ROM that was simply mapped into some unified memory location. Thus the system went from a state of "off" to "ready to go" pretty much immediately. There wasn't a need to copy the data from the ROM to RAM and then execute some stuff to get into an initialized mode. If you hunt around a bit for things like "atari 800 memory map" you c…

I just built a new desktop PC (albeit with great parts) and it boots to a usable state in Win10 in just a few seconds. To be honest it's good enough to no longer worry about it. Of course mileage on a laptop with non-quality parts will vary.

Windows on an SSD is pretty amazing when it comes to boot time. My computer spends more time on the BIOS splash screen than it does booting Windows.

Re: Why can't computers boot instantly? (2013)

#163
post #8

A bigger question for me is, why can't monitors boot instantly? So annoying that a monitor that went to sleep can sometimes take 10-20 seconds longer to wake up than the computer it is attached to.

That's on the monitor, whatever process it is using to scan for input, warm up, or other needs. Buying a cheap offbrand monitor or something low end has drawbacks.

Re: Why can't computers boot instantly? (2013)

#164

Earlier quoted context omitted.

Because all of that is on the hard disk; which may be encrypted. There's more going on during boot than you think. Bootloaders are meant to be small and simple; just enough to hand off to the OS. If your OS takes a minute to get its stuff straight; there isn't really much you can do to make the boot faster.

Oh ok, so in other words a lot of the time is before the os even reads the hard drive? That would sort of make the caching approach less advantageous

Other way around. BIOS and POST tend to be complete in It's exceedingly fast. The UEFI implementations on modern computers then have to scan the hard drive GPT to find the bootloaders, if there are any. UEFI Then hands off to the bootloader that then begin initializing the OS. At this point, you're probably anywhere from 5-7 seconds in in my experience. As your OS begins loading, it has to spin up the filesystem, and locate all the necessary files required to do it's thing. Most critical hardware (mouse, keyboard, video drivers) are loaded and initialized at this point.

Generally, your OS would be in some equivalent of a single-user mode at this point.

After the necessary local filesystem shenanigans are complete, non-critical device drivers (network, sound card, exotic storage media) tend to get initialized. Network drives if properly configured might be mapped, but generally (I.e. Windows) loads Most remote volumes after login, which is generally after the system enters multi-user mode.

Windows in particular is incredibly annoying because vast tracts of configuration data is tracked in the registry; an in-memory hierarchical key/value pair binary database. Most "Windows updates" tend to involve shell scripts/installers running and performing filesystem and registry updates while you're sitting there really wishing you knew why stuff was taking so long. Stuff is taking so long because the registry is a bloody mess, and your filesystem is getting polluted by Windows not cleaning up after itself.

God help you if you killed an update in the middle; as the scripts probably were not crafted with a User's convenience in mind, and therefore are likely to fail in exceedingly interesting ways.

Though I habitually try to be the most horribly behaved user in that regard, and I've only encountered a handful of updates that when interrupted had caused Bad Things(tm) to happen.

If you aren't into breaking things for fun and profit though, I'd not advise you doing the same.

Long story short; 5-7 seconds is the absolute longest I'll tolerate for boot from hardware to OS selection. After that, faster boots depend on OS developers to get things going faster.

Re: Why can't computers boot instantly? (2013)

#165
post #133

What gets me is how long servers take to reach the bootloader from power on. Your average modern Dell/HP desktop or laptop is there within a second or two, Windows 10 and systemd-based Linux distros on SSD can be at the login prompt within 5 seconds total. I haven't touched a Mac in a long time but I'd bet they're no worse. But a typical server BIOS takes 3-5 minutes do its thing. If you're lucky you might be able to…

I bought an old 1/10 Gbit managed switch for $25 on an online auction to play around with, and was surprised just how long (minutes) a switch can take to boot.

A managed switch is basically an embedded server with super-slow storage. If it's of a certain age you might pop the cover and find a CompactFlash card.

I run my most critical piece of home infrastructure (PiHole, of course) bare-metal on an ancient NUC-like thing with a $20 SSD because it boots and is responding to network requests in like 6 seconds.

Re: Why can't computers boot instantly? (2013)

#166
post #91
post #30

That is not a good answer. It's perfectly possible for computers to boot in a fraction of a second. The argument that computers need to go from a useless state S0 to a useful state S1 and that takes a long time is just bullshit. The question is, how close can you bring S0 to S1. This is a question of optimization. What happens is that S1 is different for different computer configurations, and processing needs to happ…

// What happens is that S1 is different for different computer configurations, and processing needs to happen. The computer and OS config doesn't change often. And it's doesn't seem slow to test that. So caching at boot should work. And caching is a low effort optimization. So it should have been implemented early. But we don't have caching at boot, why?

But macOS does exactly that. The second boot is much faster than the first one after an OS configuration change, because it has to figure out what the new cache order has to be.

This feature was introduced years ago. What is stopping other OSes from doing the same?

Re: Why can't computers boot instantly? (2013)

#167
post #99
post #91

Earlier quoted context omitted.

// What happens is that S1 is different for different computer configurations, and processing needs to happen. The computer and OS config doesn't change often. And it's doesn't seem slow to test that. So caching at boot should work. And caching is a low effort optimization. So it should have been implemented early. But we don't have caching at boot, why?

The two hard things in computer science are naming things, and cache invalidation. Remember; the computer could quite literally have been completely reconfigured out from under the BIOS. Testing that everything is the same from the computer's point of view is anything but straightforward. Also, most recognizable boot time isn't spent waiting on BIOS and POST; it's spent waiting for either the boot loader, disk encryp…

The two hard problems are:

Cache invalidation Naming And off-by-one problems.

FTFY. ;)

Post reply on HN