Closed gitgrimbo closed 6 years ago
See https://gitgrimbo.github.io/syntax-highlighting-performance/ for comparisons.
Some initial thoughts (based on highlighting some well-known JS library files - using the above URL - and Chrome 70):
Note 1 that 'slowness' is based on large resources. These libraries probably aren't intended to highlight large resources, such as https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.0/cjs/react-dom.development.js (692,446 bytes).
For smaller resources, e.g. https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/js/bootstrap.min.js (51,039 bytes), every library except Rainbow performed well enough, i.e. sub-second.
Note 2 - IE 11's performance is mostly hideous for everything, and IE 11 performance shouldn't influence any decision.
Chrome 70
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36
IE 11
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; rv:11.0) like Gecko
E.g. saving a HAR from https://reactjs.org/, clicking on the https://unpkg.com/babel-standalone@6.26.0/babel.min.js resource (a 772.7 KB JS resource), and clicking on the "Highlighted" tab:
At the moment the advice for avoiding slowdowns is don't click on the Highlighted tab for large resources, unless you are willing to wait.
Indicative times
Machine: AMD Ryzen 5 1600, 16 GB DDR4 RAM.
Possibly try other highlighters, e.g. Prism.