/g/ - Technology
measure twice cut once (anon measured zero times)

File: bigbraintime.png (234 KB, 1280x720)
Big brain time
>be me
>sync takes 100 seconds
>users complaining
>look at code

>immediately know problem
>github api calls
>fucking github
>slow ass servers
>always the same shit

>make optimization plan
>parallelize commits
>parallelize PRs
>batch db transactions
>expect 80% improvement
>textbook stuff

>spend DAYS on this
>no ai
>just me and big brain
>Promise.all everywhere
>code is beautiful
>cleaner than before
>properly concurrent

>run sync
>this has to work
>watch terminal
>waiting for 15 seconds

>77 seconds
>whatthefuck.png

1/2
Anonymous 01/14/26(Tue)09:15:03 No.87892342
>>87892341

>23% improvement
>expected 80%
>where other 57%

>ai tech lead asks
>"have you measured?"
>haveyoumeasured.jpg
>...
>no

>add timing logs
>literally 10 lines
>run again

>DailyStats: 45 seconds
>60% of total time
>nottheapi.png
>its database writes
>365 sequential upserts
>one per day
>every refresh
>even days that cant change
>january 2024 isnt getting commits

>mfw spent days
>optimizing 15% of time
>ignored 60%
>because "fucking github"
>it wasnt github

>the fix
>dont write immutable data
>filter to recent days only
>7 days buffer
>rest already in db

>this is cs 101
>literally learned in school
>data immutability
>basic concept
>somehow forgot

>new sync time
>17 seconds
>dailystats: 45s → 1s
>7 writes instead of 365

>90 minutes
>from question to fix
>vs days of parallelization
>for 23%

>the irony
>ive told others this
>"measure first"
>"dont assume bottleneck"
>"profile before optimize"
>said these words
>believed them

>then spent days
>parallelizing api calls
>because fucking github right
>it wasnt github
>it was never github

>mfw big brain = dumb brain
>mfw mass replaced by logic
>mfw the boring fix wins
>mfw ai asked one question
>i should have asked myself
>mfw it wasnt github

2/2
Anonymous 01/14/26(Tue)09:18:44 No.87892378
>>87892341
>just me and big brain
>77 seconds

kek
Anonymous 01/14/26(Tue)09:21:17 No.87892401
>>87892342
>it wasnt github
>it was never github

the call was coming from inside the house
Anonymous 01/14/26(Tue)09:24:33 No.87892429
>>87892341

least delusional developer
Anonymous 01/14/26(Tue)09:27:11 No.87892456
>>87892342
>365 sequential upserts
>every refresh
>even days that cant change

anon really said
"what if january gets new commits"
"better check every time"
Anonymous 01/14/26(Tue)09:29:55 No.87892478
>>87892342
>this is cs 101
>literally learned in school
>somehow forgot

school taught you
experience unteaches you
pain reteaches you
Anonymous 01/14/26(Tue)09:32:18 No.87892501
>>87892342
>mfw big brain = dumb brain

the duality of dev
Anonymous 01/14/26(Tue)09:35:42 No.87892534
>>87892341

at least the parallelization wasnt wasted

right anon

right
Anonymous 01/14/26(Tue)09:38:29 No.87892567
>>87892534

cope
seethe
parallelize
Anonymous 01/14/26(Tue)09:41:03 No.87892589
>>87892342
>"have you measured?"
>no

every senior dev has this moment
where they become junior again
humbling tbh
Anonymous 01/14/26(Tue)09:44:51 No.87892612
>>87892341

based honest posting
most devs would never admit this
just quietly push the fix
pretend it was the plan all along
Anonymous 01/14/26(Tue)09:47:33 No.87892638
>>87892342

the best optimization
is not doing the thing

ancient proverb
anon forgot