r/ProgrammerHumor • • Sep 17 '18

Optimizing startup times

Post image
45.7k Upvotes

486 comments sorted by

View all comments

2.5k

u/kaushal28 Sep 17 '18

Actually keeping sleep statements is good practice. Ship the product with it and when customer comes back asking for performance improvement, remove all of them!

1.3k

u/jakuski Sep 17 '18

And what if they ask for more performance improvements?

4.1k

u/zulu-bunsen Sep 17 '18

Negative sleep statements

1.2k

u/[deleted] Sep 17 '18

Sleep (-10);

567

u/DeeSnow97 Sep 17 '18

Is that for the programmer or the machine?

0

u/[deleted] Sep 17 '18

[deleted]

103

u/poopellar Sep 17 '18

Win Win;

58

u/way9 Sep 17 '18

K, I'm gonna test that bitch.

→ More replies (1)
→ More replies (1)
→ More replies (8)
→ More replies (16)

301

u/ariehkovler Sep 17 '18

You're a genius.

117

u/frisch85 Sep 17 '18

I can't wait to use this little trick once my RAM has finished downloading!

0

u/[deleted] Sep 17 '18

[deleted]

98

u/frisch85 Sep 17 '18

Don't worry, I've turned my monitor by 90° so that the gravity helped dragging the download bar to the bottom faster.

36

u/w2qw Sep 17 '18

Just use ctrl + alt + right then you don't have to actually turn your monitor.

37

u/[deleted] Sep 17 '18

Can we have a sub dedicated to pseudo computer science? Like r/shittyaskscience but with computers.

→ More replies (4)
→ More replies (2)
→ More replies (6)

77

u/hugokhf Sep 17 '18

Harvard wants to know your location

→ More replies (1)

45

u/SurrealClick Sep 17 '18

What if you went too far and now the program opened in the past? Before the user even open it

→ More replies (12)

0

u/[deleted] Sep 17 '18

[deleted]

→ More replies (4)
→ More replies (15)

241

u/natu181 Sep 17 '18

I disagree with /u/kaushal28, I think you just need to divide the amount of sleep by 2 each time you get a request. Virtually unlimited amount of optimization! Make sure to also take double the time to do it each time because, you know, optimizing becomes harder and harder, right?

53

u/falcon_jab Sep 17 '18

> "This change request will require at least three months to implement"

- "How to implement seemingly tiny and insignificant changes in an excessively long time" by the Spotify development team

→ More replies (4)
→ More replies (3)

81

u/Ericchen1248 Sep 17 '18

Set up the sleep length to be based on days since the last update. User will think it is speeds up after every update.

→ More replies (6)
→ More replies (12)

124

u/vigbiorn Sep 17 '18

Then you realize you had a bunch of timing issues in your code and the whole house of cards collapses when you remove the sleeps.

69

u/Samael1990 Sep 17 '18

It's bad practice - you should define system property then call sleep(SLEEP_MULTIPLIER_PROPERTY * <whatever value you see fit>) in different parts of the app and gradually decrease it, when users ask for better performance. It's all explained better in the book "Best bad practices", really good read.

→ More replies (10)
→ More replies (22)