Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ts-belt is 4x slower because it uses the arguments object #86

Open
icetbr opened this issue Aug 7, 2023 · 0 comments
Open

Ts-belt is 4x slower because it uses the arguments object #86

icetbr opened this issue Aug 7, 2023 · 0 comments

Comments

@icetbr
Copy link

icetbr commented Aug 7, 2023

Hi, I'm no expert, this is just an experiment I made using the code from ts belt.

https://github.com/icetbr/experiments/tree/main/perf/packages/arguments

Quoting from my repo:

const filterArgs = function () {
    var n = arguments[0];
    var t = arguments[1];

can be 4x slower than

const filter = function (n, t) {
arguments 1 x 4,193,813 ops/sec ±0.83% (23 runs sampled)
arguments 2 x 1,021,724 ops/sec ±2.65% (22 runs sampled)
direct 1    x 4,188,578 ops/sec ±0.77% (21 runs sampled)
direct 2    x 4,137,680 ops/sec ±0.87% (18 runs sampled)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant