Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Obfuscator vs. non obfuscated
(version: 0)
Benchmark.js
Comparing performance of:
Default code vs Obfuscated vs Minified
Created:
3 years ago
by:
Guest
Go to the latest result
Tests:
Default code
// Paste your JavaScript code here function hi() { console.log("Hello World!"); hello(); } function hello(){ var a = "a"; var b = "b"; log(a,b); } function log(foo,bar){ console.log(foo,bar); } hi();
Obfuscated
(function(_0x263f11,_0x1dbcfd){var _0x291091=_0x1450,_0x4ceef4=_0x263f11();while(!![]){try{var _0xe65355=-parseInt(_0x291091(0x75))/0x1*(-parseInt(_0x291091(0x7b))/0x2)+-parseInt(_0x291091(0x71))/0x3+-parseInt(_0x291091(0x7a))/0x4*(-parseInt(_0x291091(0x76))/0x5)+parseInt(_0x291091(0x77))/0x6+-parseInt(_0x291091(0x74))/0x7*(parseInt(_0x291091(0x72))/0x8)+parseInt(_0x291091(0x78))/0x9*(parseInt(_0x291091(0x79))/0xa)+-parseInt(_0x291091(0x73))/0xb;if(_0xe65355===_0x1dbcfd)break;else _0x4ceef4['push'](_0x4ceef4['shift']());}catch(_0x43f811){_0x4ceef4['push'](_0x4ceef4['shift']());}}}(_0x4221,0x58601));function hi(){console['log']('Hello\x20World!'),hello();}function _0x1450(_0x5c6f7a,_0xb796d9){var _0x422193=_0x4221();return _0x1450=function(_0x1450f6,_0x1b1b8f){_0x1450f6=_0x1450f6-0x71;var _0x2ee370=_0x422193[_0x1450f6];return _0x2ee370;},_0x1450(_0x5c6f7a,_0xb796d9);}function hello(){var _0x277a55='a',_0x252a04='b';log(_0x277a55,_0x252a04);}function _0x4221(){var _0x3e517b=['1116dUtdOP','2lYMsEN','533883KqYmXG','1789368ONPiif','4146681zZVppB','14llMatN','474967SCxgPU','3370Ekdhnm','566238tqZODc','1820619hxwcdt','30AovKfI'];_0x4221=function(){return _0x3e517b;};return _0x4221();}function log(_0x477fee,_0x201eba){console['log'](_0x477fee,_0x201eba);}hi();
Minified
function hi(){console.log("Hello World!"),hello()}function hello(){log("a","b")}function log(o,l){console.log(o,l)}hi();
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Default code
Obfuscated
Minified
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:134.0) Gecko/20100101 Firefox/134.0
Browser/OS:
Firefox 134 on Linux
View result in a separate tab
Embed
Embed Benchmark Result
Minified
69K/s
Default code
67K/s
Obfuscated
61K/s
View exact numbers
Test name
Executions per second
✓
Minified
68,582 Ops/sec
Default code
66,550 Ops/sec
Obfuscated
60,888 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll provide an explanation of the benchmark, its options, pros and cons, library usage, special JS features, and alternatives. **Benchmark Overview** The benchmark compares three versions of a JavaScript code: "Default code", "Minified" (obfuscated), and "Obfuscated". The goal is to measure the performance difference between these versions. **Options Compared** 1. **Default Code**: This version has no obfuscation or minification applied. 2. **Minified Code**: This version uses a tool like UglifyJS to compress and remove unnecessary characters, making it smaller in size. 3. **Obfuscated Code**: This version is intentionally made more difficult for humans to understand by using techniques like string encoding, variable renaming, and function reordering. **Pros and Cons** * **Default Code**: + Pros: Human-readable, easy to debug and maintain. + Cons: Larger in size, potentially slower due to overhead of parsing and executing the code. * **Minified Code**: + Pros: Smaller in size, faster execution, as it eliminates unnecessary characters. + Cons: More difficult for humans to understand and maintain. * **Obfuscated Code**: + Pros: Can be challenging to reverse-engineer or debug, potentially leading to better security. + Cons: Large difference in performance between minified and obfuscated versions. **Library Usage** None of the benchmark cases use any specific libraries. However, the `UglifyJS` tool is implied as the tool used for minification (Minified code). **Special JS Features** 1. **Immediately Invoked Function Expression (IIFE)**: The "Obfuscated" code uses an IIFE to create a new scope and hide variables from outer scopes. 2. **String Encoding**: The "Obfuscated" code uses string encoding techniques, like `%` symbols, to make variable names more difficult to guess. **Alternatives** Other approaches for measuring performance differences in JavaScript include: 1. **Node.js Benchmarks**: Measure execution time on a Node.js server. 2. **ES6 benchmarking libraries**: Tools like `Benchmark.js`, ` jsperf`, or `benchmark` provide a simpler way to write and compare benchmarks. 3. **WebAssembly (WASM)**: Measure performance differences using WASM, which provides a more direct interface between JavaScript and the hardware. When writing your own benchmarks, consider factors such as: * Use of modern JavaScript features * Eliminating unnecessary overhead (e.g., parsing, garbage collection) * Using consistent data structures and algorithms across different versions * Considering device-specific optimizations Keep in mind that performance differences can be influenced by various factors beyond just the code itself, such as hardware capabilities, browser versions, and network conditions.
Related benchmarks
Destructure vs Traditional
constructor comparison vs. instanceof vs Array.isArray 2
instanceof Array vs Array.isArray
Array isArray vs Object.prototype
Comments
Confirm delete:
Do you really want to delete benchmark?