In June 2013 at WWDC, and 22 October of the same year (almost simultaneously with the appearance of the new version in the Mac App Store) Craig Federighi promised real miracles, and a passion for debunking lies one of the strongest among the people… According to Craig, the new version of the operating system amounted to an increase of capacity batteries of laptops by 15-20 per cent), and increasing the memory size, twice. It just can’t be, because it can never be. Especially in the free redistributable version of the system.

The new version was free. A precedent was only one: in September 2001, Mac OS 10.1 “Puma” for owners of Mac OS 10.0 “Cheetah” was also free, for which the then Apple Computer was strong and not entirely pleasant reasons. Without this Express and free upgrade history “of the modern operating system for Macs” could be another epic failure of a company, most likely the latter.

Suspicious, but check out did Apple on its promises was easy. Cheating will be immediately and inevitably exposed would be outright stupid and would not bring this eccentric company any good. On her it would be different.

The sequel mini-series about Mac OS 10.9 “Mavericks”, start here.

Doubling RAM

The appetites of the operating systems increased: each new version of any system in the world needed more RAM. And the number Mass s 4, and even with 2 gigs of RAM soldered to the motherboard, the amount of which could not be increased, was immense. Almost all “forgetful” Macs used integrated graphics, consuming for their needs a large part of scarce RAM.

The owners of these Macs have refrained from upgrade operating system, impairing the Apple statistics, and getting stuck in the past. It was unpleasant, but the circumstances were even more destructive power: the owners are cheap Macs as a rule, did not have a clue about some “RAM” and was put on their Mac and the latest version of OS X.

The magic ability of the operating system to convert 2 Gigabytes 4 would definitely be in demand.

Craig explained the essence of “focus”, only adding to the confusion and suspicions of the public. To compress the unused portion of RAM that’s crazy! The algorithms of compression and decompression that was well known to all “advanced users”, require processor time and effort. And RAM, which in this wild way decided to “double down”. Intuition, life experience and common sense simply rebelled against the idea.

But MacBook Air 2009 from my friends, with 2 Gigabytes of RAM, and even with a very slow hard drive, after installing it on Mavericks literally came to life.

You will not believe it, but no magic was required. Only a sober engineering mind. Memory, especially when kilobytes were more expensive than today, a hundred or two Megs has always been a scarce resource. Virtual memory to help fight this shortage.

When the next request for allocation of RAM was impossible, from RAM to disk is unloaded some of its contents (which for the longest time did not use, and which is unloaded from memory was not banned).

In response to the query of the contents of the remote memory, the case enters the same mechanism: the disk is unloaded “unused” memory contents in its place of temporary storage were previously downloaded remote.

Record to hard disk and read data from the hard disk operations slow. Hundreds of thousands of times slower than retrieving the same data from RAM. SSDS are much more efficient, but even in this case, delays are inevitable.

Compression memory, instead of loading “have not used” data to disk, and squeezing them roughly in half, releasing half of occupied memory for other data. It is thousands of times faster than uploading data to the disk. And than read the data back.

Compression of RAM did not rule out the unloading of the disk if you compress anything it was impossible, the system moved to the next line of defense. Trying not to abuse the disk accesses.

How without changing the battery capacity, to get her to stay longer?

First understand why it took Apple. This all is simple: since 2003, the number of laptops sold by the company exceeds the number of desktop Macs. Since 2004, the laptops bring the company more revenue. From 2004 to 2013, the share of laptops has grown, and in 2013 each sold Mac table had four MacBook and all types.

And for every sold computer, desktop and laptop, had at least ten mobile devices, easy and economical living on the battery is unreal ten hours. It seems to be logical and explainable, but Apple is not satisfied.

Started with increase of battery capacity. Mobile devices are used battery is specially designed for specific models occupying the entire available volume. Did the same thing with laptops. Many were very unhappy. For example, I.

But the battery life really increased. When their lifespan came to an end in the service centers of Apple, they changed to the new one. For so little money, but Mac and much more enduring than the products of competitors.

The most popular versions of the battery began to produce independent producers.

The gap between laptops and mobile devices declined, but remained excessive.

The same problem was from Apple’s competitors – have the same UltraBook’s, for example. Intel has developed processors Haswell, who for the first time since the advent of architecture Core was not more productive than the preceding Ivy Bridge – before their creators have put other tasks. One of them was a sharp increase in efficiency.

The goal is to achieve the maximum possible reduction of energy consumption supplied and the developers of the new version of OS X. is it Possible?

As a rule, at any time in modern operating systems running multiple applications, each of which consumes energy. Even if the application window is hidden by Windows of other applications and are not visible to the user. App Nap automatically puts the app invisible to the screen in a state of “slumber”. “Nap” can be translated to English as “slumber” or “doze off”.

State is similar to sleep state system. The power consumption of the application in drowsiness decreased in ten times, almost like in a dream state, but time to Wake from slumber the application requires less.

Still managed to save by coalescing (merging) operations are triggered by timers. In the absence of load, and modern CPUs in idle state.

For the transition from the rest state to the active state and the reverse transition energy. Technology Timer Coalescing “shifts” the operation scheduled by timers in the near future (a few milliseconds) close to each other.

Timer Coalescing saves more energy than App Nap.

Tricks to increase the duration on a single charge of the battery by 15-20%, these two are not exhaustive, but their contribution was most significant.

To be continued