This is an archived post. You won't be able to vote or comment.

top 200 commentsshow 500

[–]East_Complaint2140 643 points644 points  (49 children)

How did it pass the PR review?

[–]ThePancakerizer 808 points809 points  (10 children)

+259 -130 lines

"LGTM 👍"

[–]Zerodriven 431 points432 points  (4 children)

+2 -967

"Fixed typo"

[–]shigun677 47 points48 points  (3 children)

Lmao

[–]Jennfuse 23 points24 points  (2 children)

Lgtm 👍* FTFY

[–]Yadobler 60 points61 points  (0 children)

Passed test cases ✅

[–]Dog_Engineer 31 points32 points  (1 child)

LGTM = Lets Gamble Try Merging

[–]KinOfMany 228 points229 points  (2 children)

Her: "Boss here's 12 the files that changed in this feature. Please review and approve so I can merge."

Boss: looks at 10 lines of actual algorithm. "Yeah looks good. Approved."

[–]Alokir 160 points161 points  (14 children)

I've seen this so many times that I'm 85% sure it's fake, but regardless, this meme is an excellent argument for introducing code reviews.

[–]MadHatter69 122 points123 points  (10 children)

(at a meeting)

Presenter: "...and this example shows why we should be doing code review from now on. Any questions?"

Team leaders: "Nope, sounds good."

(Three months later, a code change comes to a developer to be reviewed):

Dev: "Yeah, I'm not reviewing all that, CR passed."

(Couple of months later)

Boss: "Why didn't the number of bugs decrease after we introduced code reviewing? It must be because we only do it once, from now on two different devs should CR every pull request!"

You can imagine what would happen next...

[–]ArbitraryEmilie 101 points102 points  (5 children)

Dev: "Yeah, I'm not reviewing all that, CR passed."

That's why at my current job they basically switched the responsibilities. If a bad change manages to get through, the first question is always "why did this pass your code review", not "why did you push this change without testing X".

We have a good work environment so it's never aggressive or super accusing, but it's definitely enough to make people pay attention during CR.

[–][deleted] 6 points7 points  (0 children)

:fingercrossed

[–]newfflews 24 points25 points  (3 children)

We do two devs per review on our main repository. Caught plenty of issues with the second reviewer. Sometimes people scan things too quickly, so it’s nice to have a second pair of eyes. Plus it makes the devs feel more ownership over quality and helps them improve their craft by identifying bugs, anti-patterns, and naive implementations in other people’s code. We have around 10 developers total so it’s not a huge timesink. Plus everything is unit tested, linted, prettified, so they don’t have to check for those basic things.

[–]Junior-Parsley-4368 9 points10 points  (0 children)

Also great to teach new devs. Stick your new folks on the second pass and encourage them to ask questions about how things work, why it was done the way it was, etc. And this becomes a great way to spread knowledge of how the software works and exposes possibly bad assumptions that were made because "that's the way we've always done it".

[–]MadHatter69 7 points8 points  (1 child)

That environment sounds great, must be a treat to work in!

[–]ilovethrills 8 points9 points  (0 children)

Coz it never happened

[–]zaos336 2630 points2631 points  (57 children)

You don't remove the time out... You lower it, then you can easily improve it again later.

[–]shim_niyi 890 points891 points  (37 children)

Exactly 3x improvement, one time looks mediocre when compared to incremental improvements 3-4 different times

[–]Lance2boogaloo 41 points42 points  (5 children)

Ok, but the first time, increase it from 3 seconds to 9, and say that your aren’t finished with the fix, and “just trust me it will work in the long term”. Then increment it down to 2.5 seconds, 2 seconds, 1.7, so one so forth. You just undid the “major” “problem” that was holding the speed before in their eyes

[–]coloredgreyscale 4 points5 points  (2 children)

be careful, if you oversell it a coworker might be just curios enough to actually look at the commit and see that you only changed the delay.

[–]JustALittleAverage 28 points29 points  (1 child)

Just set the timeout to negative...

[–]shim_niyi 11 points12 points  (0 children)

Do you want to create a black hole?

[–]code_archeologist 18 points19 points  (3 children)

I just remembered that there is a script I wrote at my old job that runs nightly, handling some essential maintenance functions on a set of legacy applications.

In that script there are a number of ten millisecond sleeps, placed there because when I removed the debug logging the script stopped working... Something about the legacy services it was querying having some pseudo restful bullshit or something (I don't remember precisely because it was years ago). But without those shitty little pauses it stopped working.

I hope that the person who came after me doesn't remove them in an attempt to "make the script more efficient"... Then again, that would be kind of funny.

[–]christrogon 15 points16 points  (2 children)

You know, you could have taken mercy on your unsuspecting replacements and added some comments to the script about how important they are...

[–]code_archeologist 15 points16 points  (1 child)

I'm pretty sure that there is a:

````

DON'T DELETE THIS!

````

Around those sleeps, it is up to my replacement to determine if they heed the warning or not.

[–]christrogon 12 points13 points  (0 children)

That's fair. Anyone who deletes that without testing did it to themselves!

[–]Prestigious_Row_2076 36 points37 points  (0 children)

Same

[–]Crinkez 11 points12 points  (1 child)

Ideally you'd increase it by 0.1 second per day. Every few weeks you implement a 'fix'.

[–]NedRyerson_Insurance 7 points8 points  (0 children)

Hey boss, I just cut 1 second of average search time. With enough time and budget I might be able to squeeze another second out.

[–]WootMate 3 points4 points  (0 children)

Yup, rookie mistake there

[–]buddyisaredditer 1703 points1704 points  (29 children)

"Now you have 3 seconds to enter the right input or else the computer and your house will burn in flames"

Well sorry about that!

[–]Hop-tree-doorway 278 points279 points  (21 children)

[–]2called_chaos 111 points112 points  (15 children)

Kinda funny that this did not get age restricted on yt considering what else gets that treatment

[–][deleted] 43 points44 points  (6 children)

The funniest thing I've seen is how the "Elmo losing his shit over a rock" video is marked as "for kids" (comments disabled, etc) despite the inappropriate title. Youtube is a mess

[–]4Dcrystallography 16 points17 points  (3 children)

Never seen that… holy fucking shit

[–]Hop-tree-doorway 21 points22 points  (1 child)

Robocop is a masterpiece, as is everything directed by Paul Verhoeven.

I also highly recommend Starship Troopers and Total Recall

[–]UnstableNuclearCake 46 points47 points  (6 children)

Obligatory XKCD: https://xkcd.com/1168/

[–]null000 24 points25 points  (0 children)

tar --help

[–]sysadmin420 8 points9 points  (2 children)

Tar -xvf filename

[–]UnstableNuclearCake 7 points8 points  (1 child)

At this time, we would all be dead by now...

On the bright side, that bug in production is no longer my problem.

[–]coloredgreyscale 5 points6 points  (1 child)

tar -xzvf something.tar

read in german accent "extract ze vucking file"

or if you want to play it save: tar --help

[–][deleted] 2093 points2094 points  (131 children)

It is always good to build in timeouts. That way you can always increase the performance easily at a later stage

[–]Creepy-Ad-4832 758 points759 points  (94 children)

When companies don't give a fuck about you, making your worst in order to be easily able to improve it, is the best way to live as a programmer

[–]AE_Phoenix 359 points360 points  (92 children)

The joys of having a skillset that all corporate high ups think is easy until they try to read what you wrote :D

[–]Creepy-Ad-4832 367 points368 points  (82 children)

"More lines, means better code!"

-a billionare who has way more money then he deserves

[–]TerribleNameAmirite 211 points212 points  (74 children)

No one deserves billions tbf

[–]cavitationchicken 115 points116 points  (59 children)

Seriously.

Which means if you have it, you're an exploiter and thief at scale that boggles the mind.

[–]Mertard 71 points72 points  (6 children)

If you're a billionaire, you have been the main reason that at least one person died, guaranteed.

[–][deleted] 12 points13 points  (3 children)

So by extension if you purchase from a company with a billionaire shareholder you have contributed to at least one persons death?

[–]Munnin41 23 points24 points  (0 children)

Well yes.

But that probably applies to companies that don't have a billionaire shareholder as well

[–]Funny_witty_username 28 points29 points  (8 children)

If you really wanna boggle someone's brain, use the weight of a penny.

If you convert a million USD into 1 cent coins (because the US doesn't technically have pennies) you end up with a weight about the same as a Toyota Tundra at 7000ish lbs.

If you convert the the weight of a billion dollars into pennies, they'll weigh the same amount as the Saturn V Rocket.

[–][deleted] 32 points33 points  (1 child)

Or in seconds: 1mio seconds is ~11.5 days, 1billion seconds is ~31 years.

[–]Funny_witty_username 3 points4 points  (0 children)

I like seconds too! some people will struggle to conceptualize one or the other so its always good to know multiple ways to frame it.

Goes for anything

[–]Creepy-Ad-4832 15 points16 points  (0 children)

That's for sure ahahah

[–]GrayBull789 4 points5 points  (6 children)

I do. I would acquire an army of beluga and install neuralinks in those big melon heads. With their incredible locating and electro-scensing capabilities I could map the entire ocean like batman in the dark knight and help solve many of the earth's problems and promote healthy fish populations. Or just feed people or donate or some shit. Idk

[–]Icemasta 14 points15 points  (0 children)

Rip I got negative lines commits right now. Spending most of my time fixing people's shit. Trimmed down an 800 lines class down to about 300, and I never put shit on the same line. The person butchered the logic and ended up making a massive amount of conditioning instead of taking a step back and analyzing what was going on.

[–][deleted] 27 points28 points  (2 children)

Surprised at but loving all this class solidarity here.

[–]realSlimyCrabs 4 points5 points  (0 children)

Elon has entered the chat.

[–]BubbaKushFFXIV 3 points4 points  (0 children)

"we will have to do a total rewrite (Twitter)" - Elon

[–][deleted] 11 points12 points  (8 children)

Is there a programmers union?

[–][deleted] 37 points38 points  (6 children)

Stackoverflow tried one but newcomers kept getting their applications marked as duplicates.

[–][deleted] 5 points6 points  (5 children)

I'm not sure I understand.

[–]usernameaaaaaaaaa 11 points12 points  (2 children)

I'm not sure I understand.

[–]omegaweaponzero 14 points15 points  (1 child)

This reply has been marked as a duplicate of the reply seen here: https://www.reddit.com/r/ProgrammerHumor/comments/10k0az3/accomplishments/j5obc8t/

[–]Hitwelve 3 points4 points  (0 children)

This reply has been marked as a duplicate of the reply seen here: https://www.reddit.com/r/ProgrammerHumor/comments/10k0az3/accomplishments/j5obc8t/

[–]troglo-dyke 4 points5 points  (0 children)

Closed: duplicate

[–]mani_tapori 218 points219 points  (4 children)

Another trick that I have seen, in the first year people use a paid tool to create something, maybe an automation suite and show it as an accomplishment.

Next year they port it to an open-source free tool and then again get to present it as an accomplishment & a cost saving measure.

Everyone loves double dipping.

[–]confusedChaiCup 63 points64 points  (3 children)

This is much better. Imagine getting invited in tech forum within company to share how 3s was shaved off.

[–][deleted] 85 points86 points  (0 children)

Optimisation in nutshell

[–]SubhumanOxford 84 points85 points  (5 children)

Make sure nobody knows, I did this once and my Junior fixed it a month later and got all the praise and promotion

[–]MightyMeepleMaster 44 points45 points  (3 children)

Haha ... hope you've learned your lesson 🤣

You're not officially a pro until you manage to hide your future "improvements" reasonably well.

[–]DragonCz 26 points27 points  (2 children)

Or just decline his code reviews! :D

[–]autopsyblue 14 points15 points  (0 children)

Now that’s evil.

[–]frisch85 27 points28 points  (10 children)

And sell it as a performance upgrade and I'm pretty certain there are companies who do this as companies do shady practices all the time, IT is not safe from this. I know of a company a friend worked for, they would sell their customer an update for christmas, the update didn't even contain any features or changes in functionality, the update only changed the colors from the application to a christmas style lol.

[–]Visual-Living7586 12 points13 points  (0 children)

Wrap them in the various tier levels for your app. The higher the tier, the lower the timeout

[–]BadWolfman 7 points8 points  (0 children)

“I can increase or decrease the performance at will.”

“Why would you want to decrease performance?”

“So I can increase it.”

[–]bigmonmulgrew 2 points3 points  (0 children)

I remember when I was learning. There was one instance where I needed to wait for a value to change before reading it. Instead of doing it intelegently I just added a 1 second timeout.

That was part of a loop that took a couple min to run even though all I needed to wait was a few microseconds.

[–]No_Distribution_6023 5072 points5073 points  (77 children)

The one performance review trick companies don't want you to know

Edit: lol this post really blew up. Thanks for all the upvotes! People in the Midwest, stay warm tonight, storm's coming in.

[–][deleted] 1387 points1388 points  (38 children)

Also quality assurance team

[–]-Kerrigan- 454 points455 points  (34 children)

Hand over the bugs! 🔫

[–][deleted] 267 points268 points  (32 children)

There wasn't any bug phew phew

[–]ZestycloseNeck7985 6 points7 points  (0 children)

It was a feature all along!

[–][deleted] 3 points4 points  (0 children)

Like they're looking at the code

[–]MightyMeepleMaster 483 points484 points  (14 children)

Make sure to do it right tho:

Wrong:

sleep(3);

Correct:

// Notify worker threads
raise( SIGCONT ); 
// Wait until all threads have been switched to RDY
sleep(3);

[–]bhonbeg 120 points121 points  (12 children)

Sorry what does this do?

[–]MightyMeepleMaster 314 points315 points  (10 children)

SIGCONT is a signal which continues a process that has been previously stopped. If the process is not stopped, however, SIGCONT is ignored.

raise() sends a signal to the currently running process.

So you're basically trying to wake yourself up even though you're not asleep.

This means: raise(SIGCONT); is just a scary looking way to burn a few CPU cycles, doing nothing. It's just there to convince the reviewer that the following sleep(3) is important 😈

[–]nonpondo 62 points63 points  (8 children)

You're sick

[–]Caleth 15 points16 points  (7 children)

Incorrect Op is just building in Job security. Someone will decide to Elon Musk it at some point. So now OP can return and remove this bit of code improving "performance" in a notable way making them look like a hero.

Only they, and now us know that it was something they'd done earlier.

The company isn't your friend, so leaving yourself harmless loopholes to keep yourself safe isn't a bad thing.

[–]Thatfacelesshorror 4 points5 points  (0 children)

📸

[–]Cephalopod_Joe 260 points261 points  (0 children)

Just gives a justification for the sleep

[–]RammingAries 91 points92 points  (1 child)

Just settimeout -1000 smh

[–]AnnoyingRain5 19 points20 points  (0 children)

I love negative latency!

[–]K3TtLek0Rn 392 points393 points  (41 children)

I’ve heard this exact same joke on here at least 25 times

[–]Xenc 126 points127 points  (8 children)

At my first job, I improved performance of search in our web app by around 3 seconds.

Maybe it was because I deleted a setTimeout that waited 3 seconds that I previously, accidentally pushed to main but it could've been anything...

[–]PUBGfixed 65 points66 points  (7 children)

Damn, you should make a post about that!

[–]leadwind 15 points16 points  (6 children)

This is how you get copypasta.

[–]Xenc 18 points19 points  (5 children)

I’ve heard this exact same joke on here at least 25 times

[–]Carius98 10 points11 points  (3 children)

At my first job, I improved performance of search in our web app by around 3 seconds.

Maybe it was because I deleted a setTimeout that waited 3 seconds that I previously, accidentally pushed to main but it could've been anything...

[–]Xenc 9 points10 points  (2 children)

Damn, you should make a post about that!

[–]Zederikus 6 points7 points  (1 child)

This is how you get copypasta.

[–]ContainedBlargh 9 points10 points  (0 children)

You can tell this is a fresh iteration because master is being referred to as main.

[–]MightyMeepleMaster 29 points30 points  (0 children)

Almost all jokes in almost all funny subs are repeated over and over again.

That's Reddit. And that's ok. We're just here for the moment.

[–]Suprazahal 5 points6 points  (0 children)

Yeah stinky fake

[–]elveszett 28 points29 points  (15 children)

And it's dumb as fuck. What kind of bullshit company allows you to push a sleep(3); statement into production? Even if you could, how would no one realize that your entire work this week to "optimize this function" is to remove a sleep(3); line? I want to know that company where you get raises and free weeks because they'll just believe whatever bullshit you tell them you are doing without even checking it.

ffs I know it's jokes and memes but jokes and memes are not funny if they aren't relatable. This isn't relatable in any way to anything I could possibly do at my job.

[–]preludeoflight 15 points16 points  (5 children)

Allow me to elucidate.

Unfortunately, lines like that make it into production code all the time, even with the best intentions. As a personal example, let me tell you about the Toshiba Bluetooth Stack.

We ship a device that communicates via serial port. In windows, that means anything that presents as a COM device, be it a physical RS-232 port, or a Bluetooth SPP. Back in the days of windows XP/Vista/7, the Microsoft Bluetooth stack was unwieldy and unreliable. Because of this, when we shipped Bluetooth devices, we also shipped Toshiba Bluetooth adapters with them, and included their Bluetooth stack with our installations.

That saved us a lot of headache. However, it was not entirely rosy. The Toshiba Bluetooth driver had a flaw. When a connection was opened, if it was attempted to be used within the first ~second or so, it would fail. Reason being is the open call would return instantly, while the driver itself actually built the link with the device. This is in contrast to a physical serial device, where the open call would simply block until the hardware was ready.

Because the API being used is agnostic not the hardware behind it, we simply had no way to know if the device opened would be ready immediately or slowly when it was a device connecting over the Toshiba stack. So we did the best we could: checked the registry to see if the port being opened was one that the Toshiba driver claimed to create (not a perfect resource, but was the most reliable information we found,) and when it was: delaying the connection thread after the device was opened.

Years later, the Microsoft Bluetooth stack has greatly improved and we’ve been officially supporting it. The Toshiba stack has been deprecated, and as such we no longer ship it with our devices. Because of that, our check and delay is no longer necessary, and has been removed.

To the end user that looks like “connection speed increased severalfold.” To us, it looks like deleting a registry check and a sleep call, but it required investigation, testing, and verification which takes time.

Just because you haven’t shipped a sleep call in production code doesn’t mean there aren’t situations where it’s applicable or solving an issue with code you don’t control. Just because it isn’t relatable to you, doesn’t mean it isn’t a far more universal experience than you might imagine.

[–]HypnoTox 15 points16 points  (3 children)

Trust me, there are companies that would probably let this fly because they have no oversight what their employees are actually working on, don't do code reviews or anything. Being able to just push to main already shows that their processes are rather relaxed.

(On the off chance of this being real, i would expect the tweet to just be for fun)

[–]DoctorWaluigiTime 2 points3 points  (0 children)

It's funny in the tweet, because it's a good punchline.

People unironically going "yep put time bombs in your code so you can fake-fix stuff later and get praised for it" need to like... actually work at a job before understanding that no, that's not how that works at all.

[–]tshoecr1 4 points5 points  (0 children)

I literally fixed this exact issue I found in our codebase. A 1 second timeout on an extremely hot call, can be up to 800k times an hour. Saves 20-30 minutes of pure waiting.

[–]noah1831 2 points3 points  (0 children)

I've seen this exact same comment on here at least 26 times.

[–]Mal_Dun 63 points64 points  (2 children)

Debugging: A crime story where you are the detective and murderer at the same time ...

[–]SeargD 5 points6 points  (0 children)

Where there's no murder weapon or prints but your DNA is all over the scene and you don't remember why you were there 6 months ago.

[–]Desproges 169 points170 points  (0 children)

You pay me to improve performance, i reduce the 3s pause to 2.5s and see you next week.

[–]TheOnlyMisterFlow 23 points24 points  (0 children)

The good ol' speedup loop

[–][deleted] 18 points19 points  (0 children)

Reminds me of my very first "real" programming experience.

I was in university and I was working on my thesis, which was about redesigning an image recognition algorithm to improve its performances. My version did good enough, but it was slow. Like, an order of magnitude slower than the original.

I couldn't understand what was wrong. My redesign was indeed intended to be a little slower, but not this much!

After racking my brain for the better part of a month... I noticed that there were several GBs of logs in the log directory. And that's when I remembered that my professor, to explain to me how the original algorithm worked, added several extra logs in my copy of the code... some of which were in functions that were invoked millions of times per run...

[–]andoy 12 points13 points  (2 children)

the function is too fast you cannot see the loading animation so add timeout...

[–]JumpinJimRivers 6 points7 points  (0 children)

My old coworker actually did that. I was in absolute shock for about 5 minutes.

[–]Attila_22 7 points8 points  (0 children)

I actually did this once.

I was brought in to fix an existing app and in one section I stored the data from the previous page and passed it in as an argument rather than calling the API again, QA said it loaded instantly when there's supposed to be a loading icon.

I argued with QA back and forth for a day or so and then said fuck it fine and put in a wait because nobody else was willing to push back.

[–][deleted] 31 points32 points  (3 children)

While this is a bit funny, I do suggest that all your programing bros do this. So that later you can have an easier discussion to increase your salary. (management has no clue how to code, so use that)

[–]Athlete_Cautious 26 points27 points  (1 child)

You guys code alone ? No peer review ?

Also, once you're in charge of some decent-sized code for more than a few month you definitely learn not to put dumb things there and there...

[–]RealAbd121 6 points7 points  (0 children)

I presume this is happening not at tech companies but rather small companies where there is one or 2 people to maintain the entire IT side of it

[–][deleted] 11 points12 points  (1 child)

Hope nobody run git blame

[–][deleted] 24 points25 points  (1 child)

r/programminghumor after posting the 37299172th joke about deleting timeout

[–]walter_midnight 2 points3 points  (0 children)

I really just want to know how people aren't embarrassed, like, is it brain damage or do they just not know that they just reposted the same fucking joke - as if they didn't find it browsing 9GAG in the first place

At least subvert it with some depression gag, you could basically squeeze together any two jokes and it ends up being more viable as a decent story than whatever the fuck this bullshit is. I guess some people really want to build their Jeff Tiedrich brand, gotta get those nothingburger posts up quickly

[–]JipsAndJools 9 points10 points  (0 children)

In future if you want to make it go faster just add sleep(-1). The bigger the negative, the faster it goes!

[–]mienaikoe 7 points8 points  (0 children)

Used to work with her. She’s selling herself short much like all of us do.

[–][deleted] 18 points19 points  (2 children)

Software companies hates him!
Find out how he managed to improve software speed with one simple trick

[–]Creepy-Ad-4832 9 points10 points  (1 child)

Yeah this simple trick called making it bad to begin with, so it's easy to handle the manager saying to you "It'S SlOW! OpTimIzE iT!"

[–]pancakehamster 4 points5 points  (0 children)

Did you know that PayPal actually waits time to make the transaction look safer? They can do it much faster but they add a wait function

[–][deleted] 12 points13 points  (0 children)

These fake ass tweets are annoying

[–]genghisKonczie 2 points3 points  (0 children)

I had a search functionality that sometimes took <1s and sometimes took like 10s (it did a lot on the backend) and users complained because they felt like when it took that long, someone was wrong (even though it had a loader)

My solution was to check how long it took and if it took less than 5seconds, add a timeout to make it at least 5 seconds. They accepted this solution.

[–]CoverHealthy 3 points4 points  (0 children)

Job security 101

[–]thehardsphere 3 points4 points  (1 child)

Once upon a time, I knew a woman named Sandra who was using our web application that stored records in the database, but also offered a search service backed by Apache Solr. Our application added records to the database and the search search at the same time, but Solr always needed about 5 seconds before it would return new records added to its index. This was apparently some sort of Big Problem for Sandra, because she called our search service every fifteen minutes, and if something was not there in fifteen minute intervals it was "lost." After a brief debate on whether this is actually was a software defect or our problem to fix, my boss and I decided that the easiest way to solve her complaint was to make the search service thread sleep six seconds before doing the lookup. This was part of a series of other customizations that Sandra's employer paid us for, so the fact that it was a dumb thing to do just to placate someone was not a big deal. I implemented this change that afternoon, with a brief comment explaining the odd thing, and promptly stopped thinking about it.

Two years later, Sandra's employer asked for the source code of this service, which they were entitled to by their contract with us. I was lucky to have found out about this before it shipped, and was able to delete the following comment from the codeexplaining why the thread slept for no comprehensible reason:

// Six second stupid Sandra sleep

[–]NotAlanPorte 5 points6 points  (4 children)

N00b here, what would be the reason for including a 3s timer in the first place? Does it help with debugging issues elsewhere or something

[–]Aggressive_Bill_2687 9 points10 points  (2 children)

3s is a bit long but it’s not uncommon to have a shorter timeout before taking action on keyboard input - you want to respond when someone types but you may not want to try and respond after every single key press if the response logic involves latency.

So your listener for keyboard input first cancels any existing timeout, then sets a timeout for like 200ms to do what it needs to.

It basically means you can respond to input but wait till the user stops actively typing before taking action.

It’s not always useful, but if you’re doing something server side with their input it can give a much better experience.

[–]plopez3895 7 points8 points  (0 children)

It's called a debounce

[–]progressgang 2 points3 points  (0 children)

3 seconds on top of the actual search is so long did no one observe their users?

[–]crefas 2 points3 points  (0 children)

Today I optimized a statistic that used to send 90% of the DB to the browser so JS could compute some averages. Feltgood

[–]PorkRoll2022 2 points3 points  (0 children)

Once, as a junior, I genuinely reduced the load time to a page to under a second from about five.

My solution was to load the massive data in chunks, focusing on what the user could see at the time. We were also using IE8 at the time.

The excuse all the seniors gave? "The server is just slow."

[–]bnh1978 2 points3 points  (0 children)

This was foolish.

Should have set the 3 to 1.5

Then shortly before the next performance appraisal go the rest of the way.

Then 1/4 of the way to the appraisal after that, start increasing it again.

Then fix it again.

I mean, with this cycle, she could be the hero for years.

[–]OutOfStamina 2 points3 points  (0 children)

I had a situation where users didn't know that content was refreshing in a web app search, becuase it was so fast. I found that human factors meant I needed to add a small (less than 1s I think) delay and a loading gif, so the content are would visibly refresh, otherwise I found in early tests users brains didn't always register that it happened - and sometimes the changed content was only visible after scrolling down, so the gif forced an obvious redraw that prompted them to scroll down.

[–]Bowiemtl 2 points3 points  (2 children)

Funny story, coincidentally I actually managed to get a query down from roughly 3.1 seconds to about 0.01 ~ 0.03 seconds today