Skip to content

Consider default pageSize value in toPullStream #189

@arj03

Description

@arj03

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions