Tabler Already Proving Its Worth

About a month ago, I posted about a little program I made that simply finds key values in a “table” file and prints out the values to standard output. (learn more here) Before Tabler existed, I had a little bash script called aliastable basically doing the same thing as Tabler, and it’s reason for existing was to service my NetSearch script. The basic idea for NetSearch is that you type a little shortcut, (i.e. yt) to then have YouTube open in your browser. An easy and quick way to get to the websites you want without leaving the terminal. (Maybe I’ll make a post about this script someday.)

Now, aliastable is slow (unsurprisingly because it was written in Bash,) but also when I created the script I was still very new to shell scripting and so I could’ve definitely made a quicker script, but at the time what was important was for the script to just work. Tabler however is written in C, a much faster language than Bash due to it’s compiled nature. Even if I had optimised aliastable to high heavens, it probably wouldn’t have been able to reach the same speeds as Tabler. Running NetSearch with the old aliastable script netted the result:

time ns jc

real    0m0.071s
user    0m0.061s
sys     0m0.017s

As you can see, a fairly slow result, and compared to the next results, you can feel the sluggishness of the response when this script it used.

Swapping my old script with Tabler resulted in this:

time ns jc

real    0m0.007s
user    0m0.005s
sys     0m0.002s

Quite an impressive improvement, ~10x faster than it is with aliastable.