Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comparing cold-start to warm start

Our application takes significantly more time to launch after a reboot (cold start) than if it was already opened once (warm start).

Most (if not all) the difference seems to come from loading DLLs, when the DLLs' are in cached memory pages they load much faster. We tried using ClearMem to simulate rebooting (since its much less time consuming than actually rebooting) and got mixed results, on some machines it seemed to simulate a reboot very consistently and in some not.

To sum up my questions are:

  1. Have you experienced differences in launch time between cold and warm starts?
  2. How have you delt with such differences?
  3. Do you know of a way to dependably simulate a reboot?

Edit:

Clarifications for comments:

  • The application is mostly native C++ with some .NET (the first .NET assembly that's loaded pays for the CLR).
  • We're looking to improve load time, obviously we did our share of profiling and improved the hotspots in our code.

Something I forgot to mention was that we got some improvement by re-basing all our binaries so the loader doesn't have to do it at load time.

like image 464
Motti Avatar asked Sep 24 '08 13:09

Motti


People also ask

What is the difference between cold start and warm start?

Cold Start: Cold start refers to starting the CPU from power off,Current configuration is discarded and program processing begins again with the initial values. Warm Start: Warm start refers to restarting the CPU without turning the power off, Program processing starts once again where Retentive data is retained.

What is cold start and hot start of motor?

Ans- If the motor is continuous duty and running for some time, then a restart after tripping is a basically hot start. Cold start is an initial start, after not having run for a relatively long period of time.

What is the difference between cold start car?

This is what is known as a cold start, it means that the engine isn't yet at its optimum temperature and therefore is “cold.” While some may worry that something is wrong, a cold start is completely normal and is part of getting your car's engine up to temperature.

What is warm start up?

Warm start A warm refers to somewhere between a cold and hot start where some of the operations that take place in a cold start are still happening. This makes it faster than a cold start but still with more overhead than a hot start.


2 Answers

As for simulating reboots, have you considered running your app from a virtual PC? Using virtualization you can conveniently replicate a set of conditions over and over again.

I would also consider some type of profiling app to spot the bit of code causing the time lag, and then making the judgement call about how much of that code is really necessary, or if it could be achieved in a different way.

like image 133
Jim Burger Avatar answered Oct 06 '22 00:10

Jim Burger


It would be hard to truly simulate a reboot in software. When you reboot, all devices in your machine get their reset bit asserted, which should cause all memory system-wide to be lost.

In a modern machine you've got memory and caches everywhere: there's the VM subsystem which is storing pages of memory for the program, then you've got the OS caching the contents of files in memory, then you've got the on-disk buffer of sectors on the harddrive itself. You can probably get the OS caches to be reset, but the on-disk buffer on the drive? I don't know of a way.

like image 40
Daniel Papasian Avatar answered Oct 06 '22 01:10

Daniel Papasian