Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Highlightjs vs prettier
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Mobile Safari/537.36
Browser:
Chrome Mobile 126
Operating system:
Android
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
Highlightjs
5.6 Ops/sec
Prettier
817423.5 Ops/sec
HTML Preparation code:
<div id="log"></div> <textarea id="content"><!doctype html> <html> <head> <title>HTML Test</title> <style type="text/css"> h1 { font-size: 1em; } p { color: pink } b { color: blue } u { color: "umber" } </style> </head> <body> <h1>Hello world!</h1> </body> <script type="text/javascript"> // Say hello world until the user starts questioning // the meaningfulness of their existence. function helloWorld(world) { for (var i = 42; --i >= 0;) { alert('Hello ' + String(world)); } } </script> </html></textarea> <pre><code id="code-block" class="html prettyprint language-html"></code></pre> <!-- include highlight.js along with its default languages --> <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js"></script> <!-- include prettify with a single language --> <script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/prettify.js"></script>
Script Preparation code:
document.querySelector("#code-block").innerText = document.querySelector("#content").value;
Tests:
Highlightjs
hljs.highlightBlock(document.querySelector("#code-block"));
Prettier
PR.prettyPrint();