Speed

Sep 04, 2019

A long time ago, I came upon hy­per.js. Before then I was us­ing the na­tive ter­mi­nal shipped with ma­cOS and iTerm for a long time. The aes­thet­ics of the de­sign of hy­per.js im­me­di­ately hook me. I down­loaded it and started us­ing it for my daily re­search tasks. I im­me­di­ately find it slow. It very fre­quently gives no re­sponse to my in­put and even us­ing ls to list a di­rec­tory some­times can cause it to freeze for a few sec­onds. I tried to use it for prob­a­bly a month and even­tu­ally gave up. I re­sorted back to iTerm and ap­pre­ci­ated its speed which I never thought about be­fore. Although I still could­n’t ap­pre­ci­ate its de­sign at that time, its speed is fast enough to not hin­der my work in any way.

Two months ago, I no­ticed that hy­per.js has re­leased ver­sion 3 which they claimed to be much faster than the pre­vi­ous ver­sion. I gave it an­other try and the new ver­sion is in­deed much faster than the ver­sion I used be­fore. But af­ter sev­eral days of us­age, I can­not ig­nore the no­tice­able lag­ging (which is prob­a­bly around 100 ms). One may ar­gue such tiny lag­ging is not a big deal, but I find it un­bear­able if I in­tend to use it as my main ter­mi­nal.

The same story goes to Atom. Again, it looks much bet­ter than Sublime Text or Vim (Neovim) and has a su­perb plu­gin ecosys­tem. But it is slow, the same ex­pe­ri­ence shared by many peo­ple. Its new ver­sion cer­tainly feels much faster than the ver­sion I used one year ago. However, once in­stalled a few plu­g­ins and I started to no­tice the slow­ing down of open­ing a new file, the re­sponse from lin­ter, etc. And due to its high mem­ory us­age, once you have sev­eral ap­pli­ca­tions run­ning, it be­comes too slow to work on.

Furthermore, my re­search of­ten re­quires me to open some large MD sim­u­la­tion tra­jec­tory files (200 MB on the small end, usu­ally 1 GB and above), Atom or even Sublime Text is­n’t able to han­dle it. I have to use Vim (actually Neovim) in such case. I imag­ine many peo­ple who deal with large data file daily will find Vim/Neovim is their only truly re­li­able text ed­i­tor.

Both Hyper.js and Atom are not na­tive ap­pli­ca­tions but ones built with elec­tron frame­work which are es­sen­tially web apps/​sites run­ning on your lo­cal com­puter. I do see the ap­peal of Electron which gives de­vel­op­ers the abil­ity to write cross-plat­form soft­ware/​ap­pli­ca­tion us­ing javascript, and maybe it is the fu­ture. A good ex­am­ple of Electron-based ap­pli­ca­tion is Visual Studio Code which I have been us­ing for a well and it seems it is an ap­pli­ca­tion writ­ten with per­for­mance in mind. I do hope more apps fol­low this path.

P.S. I just read the ter­mi­nal la­tency bench­mark by dan­luu. The data there sug­gests hy­per.js is faster than iTerm (even back in 2017)! However, the bench­mark is rather sim­ple, com­pared to the day-to-day use case. But I do no­tice that the mem­ory con­sumed by hy­per.js is much higher than other ter­mi­nals. It could be the rea­son why I find it fre­quently freeze (I usu­ally will have a bunch ap­pli­ca­tions/​soft­ware - Jupyter Notebook, a bunch of tabs in chrome, PDF reader, VMD, Sublime Text, etc - go­ing on at the same time).