27

Guy needs to read some excel data...

Decides to write his function like this:

function readCell(){
fopen('filename.csv');
//some more code
fclose();
return cellValue;
}

This function was called multiple times per row of data...

Multiple hundreds of rows...

WHY

Comments
  • 0
    @ArcaneEye nah, this was php, used by a single instance.

    I'm not familiar with your particular case, but this was absolutely not necessary (I know because I fixed it)
  • 0
    in that case; if you've loaded the file into memory once, why load it again...
  • 1
    @xewl exactly my point x)
  • 1
    because: FUCK OPTIMIZATION! 🤣
  • 4
    Rename it "disk_thrash" and submit a pull request 😂
Add Comment