

Ask HN: Why can't basic OS apps stay fast? - uptownhr

Basic OS meanining, explorer or windows, the keyboard for android and just app switching and high level OS features. Ever since I started using a computer, other than DOS &amp; *nix, I always questioned why essential applications slow down.<p>When these applications slows down, it really hinders the user experience and forces users to upgrade(maybe this is why). Ever since I was a kid, I was always hopeful that the next release a new OS would solve this problem. This never happened.<p>When smartphones took off, with Android and IOS, I was again hopeful that, this time the issue would be addressed. In a sense, I was happy with IOS and OSX, the high level OS application layered for the most part, has higher level isolation. It is rare, that third party applications effect and slow them down. However, it still slows down.<p>Is this a real hard problem to solve? I would sacrafice, dedicated 20% of CPU&#x2F;Memory, locked into these apps, so I never see slow down, when switching windows. Or is this not even an option to do? If so, why is it that the OS cannot reserve CPU cycles for itself that can never be touched by third party so it is always fast.
======
creshal
> Is this a real hard problem to solve?

Somewhat. On the one hand, you have plain old feature creep – people expect
smoother animations, more animations, more features, better fleshed out
features, … and it's hard to resist those demands when you want to sell your
software.

One the other hand, you have security and reliability. All those error checks,
bounds checks, canary checks, validations, secure hand shakes, … take up time,
and it accumulates. DOS was fast, but it was also terribly insecure and most
programs crashed regularly.

~~~
uptownhr
DOS, wasn't really multitasking OS anyways. I think my main point is, is it
hard to preserve and give OS high priority over all other applications?

If it is not hard, is a big downside for app developers if they don't get 100%
control over the CPU cycles? Why is it necessary these days that apps have the
ability to push 100% on multiple cores?

At the least with multiple cores, shouldn't 1 core be dedicated to the OS, so
it never hangs due to another app? Something sacred, with a lot of gates so
devs cannot mess up the entire OS and user experience due to their app.

------
Kesty
Reserving CPU for itself will make all third party app run slower. And third
party apps are a huge selling point (look at Windows Phone), you don't want to
be behind your competition because you want a smoother experience on your
stock applications.

Also there is feature creep, the longer the system goes on the more feature,
security checks, fixed, etc... your basic system does and that will
exponentially increase the weigth of your system, requiring you to serve more
and more, and making everything else slower.

~~~
uptownhr
Isn't one of the best experience of buying a new product, phone/laptop/desktop
is that it is "fast"? Press the home button, and things appear instantly.
Click on a input field, and keyboard appears instantly. Open the app store, it
opens instantly. Switch between applications, happens instantly.

I would have these function fast over anything else. I can live with the
internet being slow and a page taking minutes to load, or an application
running a task on the background while I switch around and doing other things
and coming back. But when the OS slows down, you are locked in the App itself
being slow and not being able to fluidly switch between other apps.

As the user of the OS, I wish nothing has precedence over what I want to do.
The app should not have control or power over my OS.

~~~
mathgeek
> Isn't one of the best experience of buying a new product,
> phone/laptop/desktop is that it is "fast"?

Yes, it is. That's why when you get a new device, it's important that it
appear to be fast. If your old device was slow thanks to all those apps you
had that aren't yet on your new device, it makes the new device look even
faster. Even if your old device wasn't all that slow, the new device will make
it look like it was.

Apple is a great example of a company that uses this to its advantage. When
iOS "x" released, it was fast. Then, between iOS "x" and iOS "x+1" is when
Apple releases all these new apps and updates that require more horsepower. Oh
look, your phone isn't as fast as it used to be, but thanks to the new phone
that's coming out next month, you can run all those new apps at top speed
until we get closer to iOS "x+2" next year.

------
UnoriginalGuy
There's nothing "basic" about the core file manager/windowing system/explorer.
It is one of the more complex processes, and will invariably grow since the
potential feature set is near endless.

An on screen keyboard doesn't have to be complicated, but once you add
swype/multilanguage/dictionary/speech input/etc then it starts to require more
IO to initialize.

iOS was lag free pre-apps. Then people wanted apps, then legit multi-tasking,
and then tons of services from the OS to support multi-tasking apps. Now
you'll be running a dozen or more full time processes even excluding the
kernel.

> Is this a real hard problem to solve?

It is an easy problem to solve. You'd just have to give up tons of features
and functionality.

> I would sacrafice, dedicated 20% of CPU/Memory, locked into these apps, so I
> never see slow down, when switching windows.

That wouldn't help. Many things are IO bound not CPU/memory bound. Plus on
mobile there is still the battery X factor.

> Or is this not even an option to do? If so, why is it that the OS cannot
> reserve CPU cycles for itself that can never be touched by third party so it
> is always fast.

Sure it can. Almost all operating systems allow you to set a process as high
priority for scheduling. It just doesn't do much, because as I said it is IO
bound not CPU bound, and plus sometimes processes are waiting for an atomic
lock to come free and by prioritizing the process in the spin, you've actually
slowed and delayed the process who needs to finish up and free the lock
actually adding lag (this was a BIG problem on Windows in particular, which is
why they actually split several kernel level atomic locks).

~~~
uptownhr
> IO Bound Isn't this only for 'disk access'? If in memory, this really
> shouldn't be an issue. Given you have dedicated cpu and memory for the core
> features of an OS, shouldn't IO not become an issue?

------
lham001
some answers from Android Performance Patterns:
[https://www.youtube.com/watch?v=T52v50r-JfE&list=PLWz5rJ2EKK...](https://www.youtube.com/watch?v=T52v50r-JfE&list=PLWz5rJ2EKKc9CBxr3BVjPTPoDPLdPIFCE&index=22)

------
kkmickos
Due to reasons I had to install WinXP on my Core i7 a few weeks ago and was
astonished how snappy it was compared to Win7.

------
M8
_"...forces users to upgrade..."_

This is a good thing for computing power progress.

~~~
jackweirdy
But if that progress doesn't make the native experience any faster, what's the
point?

~~~
kedean
Well, you have two kinds of progress. One is native speed, which has been
heavily sacrificed for the other option: features. Rather than let everything
get blazing fast, we've gone for adding more cool new things, like voice
recognition. All those new features require processor time, and do more to
advance computing then 'faster' does.

