Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
classcat, clsx, obj-str, vanilla
(version: 1)
Comparing performance of:
classcat(arr) vs classcat(obj) vs clsx(arr) vs clsx(obj) vs objstr(obj) vs arr.filter(Boolean).join(" ")
Created:
5 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<script type="module"> import classcat from "https://unpkg.com/classcat?module" window.classcat = classcat </script> <script type="module"> import objstr from "https://unpkg.com/obj-str?module" window.objstr = objstr </script> <script src='https://unpkg.com/clsx@latest/dist/clsx.min.js'></script>
Script Preparation code:
var obj = { one: true, abcd: Math.random() <= 0.5, efghijkl: Math.random() <= 0.5, mnopqrstuvwxyz: Math.random() <= 0.5, efghijklmnopqrstuvwxyz: Math.random() <= 0.5, abcdefghijklmnopqrstuvwxyz: Math.random() <= 0.5, abcd: Math.random() <= 0.5, efghijkl: Math.random() <= 0.5, mnopqrstuvwxyz: Math.random() <= 0.5, efghijklmnopqrstuvwxyz: Math.random() <= 0.5, abcdefghijklmnopqrstuvwxyz: Math.random() <= 0.5, two: false, three: true } var arr = [ true && "one", Math.random() <= 0.5 && "abcd", Math.random() <= 0.5 && "efghijkl", Math.random() <= 0.5 && "mnopqrstuvwxyz", Math.random() <= 0.5 && "efghijklmnopqrstuvwxyz", Math.random() <= 0.5 && "abcdefghijklmnopqrstuvwxyz", Math.random() <= 0.5 && "abcd", Math.random() <= 0.5 && "efghijkl", Math.random() <= 0.5 && "mnopqrstuvwxyz", Math.random() <= 0.5 && "efghijklmnopqrstuvwxyz", Math.random() <= 0.5 && "abcdefghijklmnopqrstuvwxyz", false && "two", true && "three", ]
Tests:
classcat(arr)
window.classcat(arr)
classcat(obj)
window.classcat(obj)
clsx(arr)
clsx(arr)
clsx(obj)
clsx(obj)
objstr(obj)
window.objstr(obj)
arr.filter(Boolean).join(" ")
arr.filter(Boolean).join(" ")
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (6)
Previous results
Fork
Test case name
Result
classcat(arr)
classcat(obj)
clsx(arr)
clsx(obj)
objstr(obj)
arr.filter(Boolean).join(" ")
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Math.max/min vs if vs ternary operator with random 2
Math.min vs if1
classcat, clsx, obj-str, vanilla, merge-class-names
classnames , clsx, classcat
Comments
Confirm delete:
Do you really want to delete benchmark?