• Gwyneth Llewelyn

    (@gwynethllewelyn)


    I confess, I’ve been a happy user of Code Syntax Block for quite a while — a plugin which the author, Weston Router, clearly states that Syntax Highlighting (Code Block) is based upon.

    Alas, however, all the pages I had with the older plugin would suffer from an inevitable rendering slowdown — there is so much Javascript on web pages these days that such a slowdown is inevitable, and this is especially true to those scripts that attempt to recognise the language automatically — something that will consume plenty of CPU cycles on the browser. Parsing the language is also no mean feature by itself (I know, I’ve been doing some experiments for some code editors, and, believe me, it’s tough!).

    So why force the end-user to bear the burden of all that work? It makes much more sense to pre-render everything on the server, and then let the web server send the already-parsed HTML from its cache. That way, the end-user will already have everything on their browser, no need to wait for parsing!

    Also, if you ‘forget’ to set the language that your code is in (it happens…), the auto-detecting feature will only run on the server, and just once, when you save the post you’re writing. Even if it takes a fraction of a second more to save, think of how much time all those users will save when they get the already-rendered page!

    So, this plugin is definitely recommended. As a bonus: if you are already using some sort of code block on your WP setup, once you turn off whatever plugin you were using, Syntax Highlighting (Code Block) will immediately pick it up and start its magic (you might need to open and save all the pages you’ve got code on, though — I’m not quite sure if that’s really the case). That means zero effort (beyond saving) — what you already had will continue to work. And, naturally enough, when you disable this plugin, your code block will just revert to the internal WP code block instead — nothing will be ‘lost’ that way!

    If you’re still hesitant and reading this to the end… while you wasted your time here, think of how many of your users would have saved their time if you already had this plugin installed 🙂

Viewing 1 replies (of 1 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Thanks for the glowing review! Glad you took the time to encourage more sites to save more users’ time!

Viewing 1 replies (of 1 total)
  • The topic ‘It’s time to switch to get more performance!’ is closed to new replies.