We get tons of numbers as a data input from a 3rd party server with 0 context. So we resolve them on the basis of array indexing etc and reiterate in case we miss something.
Sometimes there were 100 x 100 Operations.
I studied the end point and saw that we can let go the usage of some APIs and webhooks and instead fetch data from a new api.
So I studied the payload logic and wrote a brand new extraction logic plus calculation logic,
Reduced the complexity to O(n), previously it was almost O(n3). Created a new table in database to store most frequently used and rarely recalculated values. Did somw other tom foolery and it resulted in over 100 plus files change.
View all comments
10
u/magneticaster Full-Stack Developer Aug 15 '24
I once rewrote the entire calculation logic of my project just because I was bored. Changed over 100 files.
PR Review was Wild