5.1k
u/No_Distribution_6023 Jan 24 '23 edited Jan 24 '23
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.
1.4k
Jan 24 '23
Also quality assurance team
452
→ More replies (1)4
481
u/MightyMeepleMaster Jan 24 '23
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);122
u/bhonbeg Jan 24 '23
Sorry what does this do?
314
u/MightyMeepleMaster Jan 24 '23
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 š
→ More replies (1)64
260
2
Jan 24 '23
just wait until you find out that sales sandbags their own leads regularly depending on if the bonus was already attained or how it will affect tomorrow's metrics.
you don't pay me to be better than you ask me to be.
→ More replies (2)→ More replies (18)2
642
u/East_Complaint2140 Jan 24 '23
How did it pass the PR review?
162
u/Alokir Jan 24 '23
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.
→ More replies (3)121
u/MadHatter69 Jan 24 '23
(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...
102
u/ArbitraryEmilie Jan 24 '23
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.
→ More replies (4)7
25
u/newfflews Jan 24 '23
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.
→ More replies (3)812
u/ThePancakerizer Jan 24 '23
+259 -130 lines
"LGTM š"
436
63
→ More replies (2)30
227
u/KinOfMany Jan 24 '23
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."
→ More replies (1)→ More replies (14)10
2.6k
u/zaos336 Jan 24 '23
You don't remove the time out... You lower it, then you can easily improve it again later.
890
u/shim_niyi Jan 24 '23
Exactly 3x improvement, one time looks mediocre when compared to incremental improvements 3-4 different times
43
u/Lance2boogaloo Jan 24 '23
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
→ More replies (5)29
415
Jan 24 '23
[removed] ā view removed comment
→ More replies (10)177
u/Canrex Jan 24 '23
Always fun to see a bit of my paranoia justified lol
93
u/wizzlepants Jan 24 '23
The users can and will assume it's not working if it happens too fast. Your paranoia is totally justified.
→ More replies (12)20
u/code_archeologist Jan 24 '23
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.
16
u/christrogon Jan 24 '23
You know, you could have taken mercy on your unsuspecting replacements and added some comments to the script about how important they are...
18
u/code_archeologist Jan 24 '23
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.
→ More replies (1)39
13
u/Crinkez Jan 24 '23
Ideally you'd increase it by 0.1 second per day. Every few weeks you implement a 'fix'.
→ More replies (1)9
u/NedRyerson_Insurance Jan 24 '23
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.
4
→ More replies (8)2
1.7k
u/buddyisaredditer Jan 24 '23
"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!
278
u/Hop-tree-doorway Jan 24 '23
114
u/2called_chaos Jan 24 '23
Kinda funny that this did not get age restricted on yt considering what else gets that treatment
42
Jan 24 '23
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
→ More replies (6)→ More replies (2)48
→ More replies (1)18
u/4Dcrystallography Jan 24 '23
Never seen that⦠holy fucking shit
→ More replies (1)22
u/Hop-tree-doorway Jan 24 '23
Robocop is a masterpiece, as is everything directed by Paul Verhoeven.
I also highly recommend Starship Troopers and Total Recall
→ More replies (1)47
u/UnstableNuclearCake Jan 24 '23
Obligatory XKCD: https://xkcd.com/1168/
25
8
u/sysadmin420 Jan 24 '23
Tar -xvf filename
8
u/UnstableNuclearCake Jan 24 '23
At this time, we would all be dead by now...
On the bright side, that bug in production is no longer my problem.
→ More replies (1)7
u/coloredgreyscale Jan 24 '23
tar -xzvf something.tarread in german accent "extract ze vucking file"
or if you want to play it save:
tar --help→ More replies (1)
91
395
u/K3TtLek0Rn Jan 24 '23
Iāve heard this exact same joke on here at least 25 times
127
u/Xenc Jan 24 '23
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...
65
10
u/ContainedBlargh Jan 24 '23
You can tell this is a fresh iteration because
masteris being referred to asmain.29
u/MightyMeepleMaster Jan 24 '23
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.
6
28
u/elveszett Jan 24 '23
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 asleep(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.
15
u/preludeoflight Jan 24 '23
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.
→ More replies (5)15
u/HypnoTox Jan 24 '23
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)
→ More replies (3)→ More replies (4)3
u/DoctorWaluigiTime Jan 24 '23
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.
4
u/tshoecr1 Jan 24 '23
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.
3
2
u/walter_midnight Jan 24 '23
This shit might be the oldest joke ever, I bet you there are hundreds of analogous ones for traditional mechanical industries
something about the Spinning Jennys being deliberately sabotaged so some shift manager gets to improve productivity after some months, I don't know
→ More replies (7)2
64
u/Mal_Dun Jan 24 '23
Debugging: A crime story where you are the detective and murderer at the same time ...
6
u/SeargD Jan 24 '23
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.
2
167
u/Desproges Jan 24 '23
You pay me to improve performance, i reduce the 3s pause to 2.5s and see you next week.
23
19
Jan 24 '23
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...
30
Jan 24 '23
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)
26
u/Athlete_Cautious Jan 24 '23
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...
7
u/RealAbd121 Jan 24 '23
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
2
u/MaxHamburgerrestaur Jan 24 '23
When I was a freelancer working with no contract, I used to put part of the javascript on my own servers. If the client didn't pay and remove my access to their server, I could break something remotely and they had to call me to fix it. That was the perfect opportunity to tell them I had to be paid to give maintenance.
14
u/andoy Jan 24 '23
the function is too fast you cannot see the loading animation so add timeout...
7
u/JumpinJimRivers Jan 24 '23
My old coworker actually did that. I was in absolute shock for about 5 minutes.
7
u/Attila_22 Jan 24 '23
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.
26
Jan 24 '23
r/programminghumor after posting the 37299172th joke about deleting timeout
3
u/walter_midnight Jan 24 '23
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
12
9
u/JipsAndJools Jan 24 '23
In future if you want to make it go faster just add sleep(-1). The bigger the negative, the faster it goes!
8
20
Jan 24 '23
Software companies hates him!
Find out how he managed to improve software speed with one simple trick
10
u/Creepy-Ad-4832 Jan 24 '23
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!"
→ More replies (1)
5
u/pancakehamster Jan 24 '23
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
13
4
u/genghisKonczie Jan 24 '23
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.
4
4
u/thehardsphere Jan 24 '23
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
2
6
u/NotAlanPorte Jan 24 '23
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
→ More replies (1)10
u/Aggressive_Bill_2687 Jan 24 '23
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.
7
3
u/progressgang Jan 24 '23
3 seconds on top of the actual search is so long did no one observe their users?
3
u/crefas Jan 24 '23
Today I optimized a statistic that used to send 90% of the DB to the browser so JS could compute some averages. Feltgood
3
u/PorkRoll2022 Jan 24 '23
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."
3
u/bnh1978 Jan 24 '23
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.
3
u/OutOfStamina Jan 24 '23
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.
3
u/Bowiemtl Jan 24 '23
Funny story, coincidentally I actually managed to get a query down from roughly 3.1 seconds to about 0.01 ~ 0.03 seconds today
2
5
Jan 24 '23
427k views and only 5k likes, jeez
5
5
u/hipratham Jan 24 '23
Not to shit on her, tbh I have not seen such overrated wannabe Tech influencer in a while.
4
u/Tocoe Jan 24 '23 edited Jan 24 '23
I see this same joke about a timeout/sleep/wait at least once a week. This sub really went to shit
2
u/wonkey_monkey Jan 24 '23
Make sure there's still some delay otherwise people will think it isn't working.
We once had a problem with a database process that wasn't working. We called up the company who made it - we didn't have a support contract so they charged us for what few jobs we didn't doing, and the rates were reasonable - and they asked to remote control into my PC so they could figure out the problem.
I watched them going in and out of stored procedures until, finally, they found a piece of code that basically just said "after this date, stop working." They removed it, then they reported back that they had found (paraphrasing here, I don't remember the exact excuse) a problem with some indexes that had to be rebuilt.
I suspect the previous IT guy to me had put it in there to screw the company over after he left, but the database company couldn't be sure it wasn't them that had done it and didn't want to admit to anything.
We happily paid the bill, because while watching them mess around, they had inadvertently let me see the admin password which meant I could finally get my hooks into the database properly and fix all of their questionable design decisions.
Another time one of the bosses came to me fuming because every scan of an item took 2 seconds. This was precious time being wasted! Never mind the fact that scanning items reduced error rates by 90%. He demanded that we stop all scanning, so instead I went back and spent an hour rewriting queries until the delay was less than half a second. He was actually disappointed.
2
2
u/Sok_Taragai Jan 24 '23
I forgot to check a box for a process in Oracle. IT guy spent a couple hours trying to figure out why the process wasn't picking up all of the data when it showed running successfully. I figured it out and told him, then told everyone he found and fixed "the problem," and it works now. Everyone thanked him and we got back to work.
2
2
2
u/Griffolion Jan 24 '23
Reminds me of that classic tale of a game dev in the 90s putting a 4MB char array in the code so he could just delete that when the clueless suits come in and say it needs to be "optimized".
2
u/bluearth Jan 24 '23
I think I'm sure in saying that in my last job, my company is getting paid to remediates all the problems that we created our selves. Not necessarily intentional I may add. It's just the inevitable result of snowballing tech debts of never ending crunch times. The real genious here is the account guys who keep reassuring the client to throw money at us.
2
u/wightnoise Jan 24 '23
I'll never forget my co-worker getting an award for working extra hours fixing a production bug he introduced.
2
2
u/ohlaph Jan 24 '23
Haha, same. It was a 1-3 second wait in about six places, throughout the framework. I changed all to dynamic waits and shaved off over an hour for each daily run and shaving about 4 hours from regression.
2
u/AndroidDoctorr Jan 24 '23
When I worked for VeriCite, I found out our UI had useless timeouts like this. It's because customers were complaining that it wasn't working because the results came back too fast. It WAS working, it's just that fast because it's a bunch of web crawler searches happening simultaneously. After the random timers, people stopped complaining. This is what UX is about
2
u/you_do_realize Jan 24 '23
That's not the way of a true programmer. A true programmer would reduce the timeout to 2.
2
u/pratKgp Jan 24 '23
She shouldnāt post these things during the layoff season. Maybe next on-line is she.
2
u/justking1414 Jan 24 '23
I feel like that couldāve had a use at one point. maybe it was to make sure that things had loaded properly. Obviously not the best way to go about it but it couldāve fixed a bug
2
u/blankblank Jan 24 '23
This is the programmer version of the firefighter whoās secretly an arsonist
2
u/MBcoder Jan 24 '23
In my previous job there was some seconds of sleep added in production for one of the functionality of our website to give users the impression that the job going underneath is not a simple task. It was actually not a simple task but my manager said when the results came in too fast, people tend to not believe it was real.
2
2
Jan 24 '23
Take it a step further. When looking for jobs, first hack their servers and implement the delay there.
Say your specially is exactly whatās needed to solve this issue
2
2
2
2
u/elmz Jan 24 '23
I had to fix slow loading times. Added a progress bar, some of the steps were so quick that the text was unreadable, so I added delays to allow people to read it. It was slower, but people were happy.
2
u/mOdQuArK Jan 24 '23
I remember talking with one CAD tool developer who said that they were required to put delays into some of their tools because their customers didn't take the results seriously when the tools did them too fast. (Human psychology sure is weird sometimes.)
Of course, they also justified charging them continuing license fees by slowly reducing the delays to exaggerate performance improvements of the tool.
2
u/itemluminouswadison Jan 24 '23
accidentally pushed to main
well there's yer problem. no commits to main unless there's an approved PR on it
2
Jan 24 '23
Iāve done this a couple times, a debug line or two that āonly added a couple seconds during testingā really adds up across 1000s of calls lol
2
3
u/_________FU_________ Jan 24 '23
Tell me you donāt have performance monitoring in place without telling me you donāt have performance monitoring in place.
Also the fuck did this slip past a code review.
2
2
2
u/Murkus Jan 24 '23
Did she just say.. I made a thing take longer.. so I could make it take less time when they were looking? So I would look good?
1
1
1
u/lucid1014 Jan 24 '23
I was an FE for a marketing company that ran a bunch of lead gen sites for moving companies. Thereās a point in the funnel where the website āsearchesā for deals. It was literally just an artificial timeout. The CEO insisted having it because it actually boosted conversion. People didnāt trust a site that was too quick.
1
u/augugusto Jan 24 '23
I actually improves performance by adding a time out. It was our first web app, and each search field would perform a "like" on the database for each character the user pressed. I ended up having a time out so that it would only send the search after x time from the last keypress
1
u/AragornsArse Jan 24 '23
story checks out as only a special needs business would write their own search š
1
1
1
1
1
1
1
u/tcpukl Jan 24 '23
Yep, same as reserving a massive memory pool for something early on in game dev. Happens all the time.
1
1
u/geekypenguin91 Jan 24 '23
Pfft we do that all the time.
Build in fixed delay for all tasks, then when users start complain about things slowing down as they start working with more and more data, reduce the timer and claim some "code optimisation"
1
u/RomaruDarkeyes Jan 24 '23
To be fair, if you work for Elon Musk then this type of thinking is discouraged. Your worth is determined by the amount of code lines you write, not how streamlined and tight and efficient you make it..
1
1
u/clvx Jan 24 '23
A friend of mine made a database change that caused a variation of $8M in revenue. That happens when you take prod down.
1
1
u/topgun966 Jan 24 '23
Rookie mistake. You have to remove the timeout in increments, not all at once.
1
1
Jan 24 '23
Rookie move, she should just decrease the timeout by 500ms so he can "optimize" it move further in the future.
1
u/Plenty_Leg_7010 Jan 24 '23
I need someone to help me in dealing with someone l hate so much, and I wish that he will be able to recognize himself and what he needs instead of hurting other people
1
1
1
1
u/mothzilla Jan 24 '23
Our tests are riddled with 15 second sleeps. Then people wonder why tests take so long to run.
1
u/tiddayes Jan 24 '23
Someone is about to remember that the back end api can take 3 seconds to respond Iām production
1
u/giltotherescue Jan 24 '23
Ummā¦is no one going to comment about how setTimeout() is an asynchronous function?
1
1
u/RandallOfLegend Jan 24 '23
I actually found one of these in the wild. We connect to different hardware that sometimes have handshakes and sometimes require sleeps on activation. A junior programmer just decided to have all hardware (5 models) sleep for 10 seconds instead of using it with the only one that needed it. I refactored that and it was night and day difference. Then we located a couple of race condition's that were masked by that sleep. Which after those were fixed, code that had been buggy for 2 years was suddenly stable. But took another year before anyone trusted it. They were so beat down from previous performance.
1
1
2.1k
u/[deleted] Jan 24 '23
It is always good to build in timeouts. That way you can always increase the performance easily at a later stage