Category: Automation
May 14, 2020
Fast I/O and day to day work

I waited a long time to upgrade my beloved mid 2012 11" MacBook Air, since Apple just didn't offer anything compelling with a working keyboard. Until the 2020 MacBook Air, which i just got a little while ago.

This MacBook might not have the fastest processor on the market (i got the fastest you could order), but man - this thing is plenty fast to get my work done. One thing i specifically noticed is how fast the I/O is and how important fast I/O is to my daily work. I realised this, when i wanted to clean up some code for work:

We have a strings.json file containing many strings, which we use throughout an application (localisation etc.). Each string has a "name" attribute whereby it is referenced throughout the application. I wanted to clean up the json file and delete strings, we no longer use in the application. To do this, i had to search all the source files of the application for an occurrence of a strings "name". If i'd not find an occurrence, i'd know, the string is no longer being used (and i can delete it from strings.json).

Since this is not the last and only time, i'll have to do this work, i started automating the task and wrote an AppleScript which will of course use BBedit (which never has, and still doesn't suck!) to go through a text file - which contains the "name" attributes of all of our strings, one per line - line by line and search the application source files for an occurrence of the string, recording the number of matches it found and inserting that number right at the beginning of the current line (in the text file). There were 509 source files it had to search in every go. And now look how unbelievably fast this was when i had the application source files stored on the internal SSD of the Air. Each visible update to a line of text represents having searched all 509 source files:

Isn't this crazy fast?

Posted in: , , by seiz | Comments (0)