News for hackers. Stuff that matters.
Re:Microlight.js, a code highlighting library by hougaard on Monday May 30, 2016 @04:00PM (#11802844)
And it made the site super sluggish. Guess that huge regex needs a dedicated cpu.

Almost un readable on a fairly quick phone...

Re:Microlight.js, a code highlighting library by mcbits on Monday May 30, 2016 @04:59PM (#11803164)
Is it really the regex causing the lag? I haven't jumped into the code yet, but I would expect (or at least hope) the highlighter runs once and the lag is due to whatever DOM/styles it's generating.
Re:Microlight.js, a code highlighting library by lucideer on Monday May 30, 2016 @04:34PM (#11803027)
Site works with no lag on my low end android. Someone else commented on issues on iPhone6 so possibly a Safari-specific bottleneck being hit.
Re:Microlight.js, a code highlighting library by yxlx on Monday May 30, 2016 @04:47PM (#11803093)
Hello, Firefox on Android user here on a tablet from circa 2012. Extreme lag, unlike most websites.

There are definitely unacceptable performance issues with the syntax highlighter javascript.

It looks great, it's a cool project, but it is not suitable for use anywhere.

Re:Microlight.js, a code highlighting library by STRML on Monday May 30, 2016 @06:26PM (#11803570)
Looks like the `overflow:auto` on the page container div, not actually anything to do with the library.
Re:Microlight.js, a code highlighting library by jaytaylor on Monday May 30, 2016 @06:09PM (#11803501)
Disclaimer: This is not my library, this is what I've gleaned from reading the code. I could always be wrong!

It actually can use RegExp's, but they're only being used to locate the language primitive types words (e.g. char, wchar_t, etc..).

Most of the library is actually written as a hand-implemented state machine rather than relying on regular expressions.