47
donuts
7y

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.

Comments
  • 1
    That is the best, feeling aye. Have all the ++'s.
  • 1
    Tell us more, how did you do that?
  • 2
    @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.
  • 0
    @LinusCDE congrats, well done!
  • 1
    Best. Feeling. Ever! Congrats billy
  • 0
    Except when it doesn't, and you're stuck waiting for it or trying to fix it to execute before you can leave. 😂
  • 0
    Plot twist - it's a very powerful local PC emulating the massive mainframe server as fast as it can!
  • 0
    @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!
  • 0
    @billgates nice, great work!
  • 1
    @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.
  • 1
    @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.
  • 1
    BTW 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....
Add Comment