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

Migrate deque from denque to Js-sdsl Deque #1649

Open
ZLY201 opened this issue Sep 8, 2022 · 9 comments
Open

Migrate deque from denque to Js-sdsl Deque #1649

ZLY201 opened this issue Sep 8, 2022 · 9 comments

Comments

@ZLY201
Copy link

ZLY201 commented Sep 8, 2022

Hey! I'm the developer of Js-sdsl. Official website: https://js-sdsl.github.io/.

Now, we published the version 4.1.4.

I see you are using denque.

In benchmark, we have confirmed that Js-sdsl is several times faster than denque and nearly equal to Array.push in the case of push elements.

We would like to invite you to migrate deque related functions to Js-sdsl v4.1.4 and I am willing to submit a pull request for this change.

Looking forward to your reply! :D

@luin
Copy link
Collaborator

luin commented Sep 8, 2022

Hey @ZLY201 👋 ,

Nice work! Looks promising to me. The only concern is the package size (9KB vs 1.5KB). Some users use ioredis in their lambda functions so package size matters.

@ZLY201
Copy link
Author

ZLY201 commented Sep 8, 2022

Thanks!

const xxx = require("js-sdsl/xxx"); support is being planned.

@ZLY201
Copy link
Author

ZLY201 commented Sep 18, 2022

Hey, I want to do a benchmark, but I see this: #186.

The command about benchmarking seems to have been removed.

Could you tell me how to do a benchmark with perf/migrate branch and main branch?

PR's here: #1650.

By the way, I do a benchmark in mongodb: mongodb/node-mongodb-native#3419.

This proves that the performance gain of deque in the database connection is amazing.

I'd love to see the improvement in ioredis.

@ZLY201
Copy link
Author

ZLY201 commented Sep 18, 2022

I finally find a way to do insert test.

github action

result

main

  • on redis 2
Inserting fixtures keys in the server ...
Inserted 1000000 keys in 19806.79 ms.
  • on redis 6
Inserting fixtures keys in the server ...
Inserted 1000000 keys in 13722.09 ms.

perf/migrate-dequq

  • on redis 2
Inserting fixtures keys in the server ...
Inserted 1000000 keys in 16444.18 ms.
  • on redis 6
Inserting fixtures keys in the server ...
Inserted 1000000 keys in 13319.98 ms.

You can see the time is reduced.

For the memery, see https://js-sdsl.github.io/#/test/benchmark-result?id=deque

@ZLY201
Copy link
Author

ZLY201 commented Sep 20, 2022

Ping @luin to have a look.

@ZLY201
Copy link
Author

ZLY201 commented Oct 2, 2022

@js-sdsl/deque published!

@ZLY201
Copy link
Author

ZLY201 commented Nov 5, 2022

@luin Could you give me some responses?

@luin
Copy link
Collaborator

luin commented Nov 5, 2022

Hey @ZLY201 , I don't have the bandwidth for this at the moment, so maybe other contributors may look at this. Looks like the performance is pretty similar on Redis 6 (~3%)?

@ZLY201
Copy link
Author

ZLY201 commented Nov 5, 2022

Hey @ZLY201 , I don't have the bandwidth for this at the moment, so maybe other contributors may look at this. Looks like the performance is pretty similar on Redis 6 (~3%)?

Okay, I'll find a way to test it more carefully at redis 6.

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

2 participants