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

Consider default pageSize value in toPullStream #189

Open
arj03 opened this issue Jan 13, 2022 · 3 comments
Open

Consider default pageSize value in toPullStream #189

arj03 opened this issue Jan 13, 2022 · 3 comments

Comments

@arj03
Copy link
Member

arj03 commented Jan 13, 2022

I was looking at some numbers today and noticed that there was a significant overhead of using toPullStream in some cases. The following query takes 2.4 seconds:

pull(
      ssb.db.query(
        where(
          and(
            author('@QlCTpvY7p9ty2yOFrv1WU1AE88aoQc4Y7wYal7PFc+w=.ed25519')
          )
        ),
        toPullStream(),
        pull.collect((err, results) => {
            ....

while:

    ssb.db.query(
      where(
        and(
          author('@QlCTpvY7p9ty2yOFrv1WU1AE88aoQc4Y7wYal7PFc+w=.ed25519')
        )
      ),
      toCallback((err, results) => {
            ....

takes 1.2s.

It turns out that toPullStream actually does pagination internally in all cases. Tweaking this number made quite a difference. So I'm wondering how this number came about? And if it should be something like maybe 1000 instead?

@staltz
Copy link
Member

staltz commented Jan 13, 2022

Hmm, yeah 20 might be too low. I think I came up with the number arbitrarily.

@arj03
Copy link
Member Author

arj03 commented Nov 8, 2022

Remember this one? :)

@staltz
Copy link
Member

staltz commented Nov 8, 2022

Hmmm

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