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

useQuery usage is load much slower in 0.18 #778

Closed
thomasbroderick opened this issue Aug 28, 2020 · 6 comments
Closed

useQuery usage is load much slower in 0.18 #778

thomasbroderick opened this issue Aug 28, 2020 · 6 comments

Comments

@thomasbroderick
Copy link

What is the problem?

After upgrading from 0.16 to 0.18, my pages and components that utilize useQuery and Suspense are loading 10x slower.

Steps to Reproduce

  1. Use postgres db with over 20K rows
  2. Use CLI to generate queries and pages for the table
  3. Navigate to /items

Versions

macOS Catalina | darwin-x64 | Node: v14.5.0

blitz: 0.18.0 (global)
blitz: 0.18.0 (local)

Package manager: yarn
System:
OS: macOS 10.15.6
CPU: (8) x64 Intel(R) Core(TM) i5-1030NG7 CPU @ 1.10GHz
Memory: 205.15 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 14.5.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.7 - /usr/local/bin/npm
Watchman: Not Found
npmPackages:
@prisma/cli: 2.5.1 => 2.5.1
@prisma/client: 2.5.1 => 2.5.1
blitz: 0.18.0 => 0.18.0
react: 0.0.0-experimental-33c3af284 => 0.0.0-experimental-33c3af284
react-dom: 0.0.0-experimental-33c3af284 => 0.0.0-experimental-33c3af284
typescript: 3.9.7 => 3.9.7

output of `blitz --version --verbose`

Other

Please include applicable logs and screenshots that show your problem.

@kitze
Copy link

kitze commented Aug 29, 2020

I have the same issue, super slow in prod.

@flybayer
Copy link
Member

@thomasbroderick @kitze can you try upgrading react and react-dom to 0.0.0-experimental-94c0244ba and see if that fixes it?

@flybayer
Copy link
Member

@thomasbroderick are you loading all 20,000 items on a single page without pagination?

@thomasbroderick
Copy link
Author

@thomasbroderick are you loading all 20,000 items on a single page without pagination?

Not displaying them on the page, but loading the item names for use by a material-ui autocomplete component. I tried upgrading react and react-dom but it doesn't appear to have resolved the long loading time issue.

@flybayer
Copy link
Member

@thomasbroderick ok yeah so probably adding superjson for serialization slowed down serialization enough to notice it on 20k items.

We can work on improving this perf, but regardless you should look at implementing a search feature instead of loading all 20k. Probably postgres built in search would be sufficient.

@flybayer
Copy link
Member

@kitze probably whatever issue you have is something other than this. For slow perf in production, the very first thing is to ensure your deployment and DB are in the same region (which I think you did, but we need to verify this).

@flybayer flybayer changed the title Suspense elements load much slower in 0.18 useQuery usage is load much slower in 0.18 Aug 29, 2020
@itsdillon itsdillon transferred this issue from blitz-js/blitz Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants