Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@cr78 I guess by using bettet performing variables.
I once optimized a task for an AoC-Puzzle in Java. I checked if a field was active by searching the variables in an ArrayList.
It took 8 hours on a VPS. When I changed it to a two-dimensional boolean-array (boolean[][]) it gave me the same (correct) solution in under a SECOND!
Depending on the Lang @billgates used (I guess C# 😁) he could speed up performance in a similar manner by reducing a lot of uneccessary checks or stick to use primitives instead of complex classes. -
ILMostro2437yExcept when it doesn't, and you're stuck waiting for it or trying to fix it to execute before you can leave. 😂
-
Plot twist - it's a very powerful local PC emulating the massive mainframe server as fast as it can!
-
donuts238487y@cr78 I'll need to review today, but I think 2 things:
-use the correct class
-create 2 (spreadsheet) readers: one for reading and for writing. I'm guessing doing the R+W with same one like before is like accessing 2 apps running on a HDD and using ALT+TAB, the switching cost adds up when you do it 1 million times...
Ooh I've entered Big O n Algo domain! -
donuts238487y@LinusCDE Yes I did that before, on a different app switched an List to a Map of Lists, data structures and Big O again and I didn't know this stuff back then! Search vs lnsertion Time.
-
donuts238487y@Fiftyseven I did get a new PC with an i7 3.3Ghz and 32GB RAM but I haven't switched over yet. Current one is still an i3, 8GB RAM.
-
donuts238487yBTW the old code has been in Production for years.... written by "Senior Developers" I guess the Senior refers to their age/length of career... not their skill....
Work today was good although put in 2 hrs of overtime....
But I optimized some code by changing out a class. Now it does the same thing except does it:
in SECONDS on my local PC
instead of 10+ MINUTES on a massive server.
undefined