3 ms·
at 13M ops/s I could care less, this is not something that will be called that often in any real application the size difference is negligible as well, and the
by verdverm 4y ago
at 13M ops/s I could care less, this is not something that will be called that often in any real application
the size difference is negligible as well, and the only reason it is there is because you turned it into a function. Don't use the function at all, just use builtin array operations inline...
my code doesn't need tests, types, or docs because it is builtin and known to work
the point is that we have another, unnecessary npm dependency
https://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/ https://qz.com/646467/how-one-programmer-broke-the-internet-...
---
edit: if you did an actual fair comparison, you would see that my code is actually shorter than yours
https://babeljs.io/repl#?browsers=defaults&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=GYVwdgxgLglg9mABANwKYCcAmb0FsAUAlIgN4BQAkOqlCOkgIboDmIuqYUAzgHTAwAbKBnwAPRAF4AfInEAyOYigBPAA6o4wRE2aSJExACIuUdDDDNDhHgCs45_IaOEyAXzIfQkWAkQRRRKSUAjSIJuiSRoYANGSI8YgwkQAMsQnaLADcHvHAcBH4mYmIADwZrOycvCEWUAAWRcTk6TBa-Pg6kTpsHNwA2jAA1IMAusQKSmoaWp36Bsam5pZNcelhpogT-OGIg_PO2WvrEXvlhwnu8ZeIq9S09MfZ7kA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=true&timeTravel=false&sourceType=module&lineWrap=true&presets=env%2Creact&prettier=true&targets=&version=7.18.13&externalPlugins=&assumptions=%7B%7D https://babeljs.io/repl#?browsers=defaults&build=&builtIns=f...
and if you are going to claim ops/s, you ought to link to where / how you did that. How does my fair example compare?
- TiQNault 4y agoThose perf gain compound over time with every render cycle. Not every device uses a powerful desktop processor like the one used in the benchmark (Ryzen 5 5600x). > my code doesn't need tests, types, or docs because it is builtin and known to work Oh boy. > if you did an actual fair comparison, you would see that my code is actually shorter than yours My comparison is 100% fair. Your new version does not work; `arguments` is an array-like object and does not support Array.filter. > the point is that we have another, unnecessary npm dependency If you value having one less dependency over everything else, then more power to you, but clsx and classnames are very popular libraries for a reason. > you ought to link to where / how you did that It's in the readme. I locally added your version and ran the following: https://github.com/alexnault/classix/blob/main/benchmark/index.js https://github.com/alexnault/classix/blob/main/benchmark/ind... Feel free to run it yourself.
- verdverm 4y agohttps://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/ https://qz.com/646467/how-one-programmer-broke-the-internet-...