#[resolved] performance seems low

58 messages · Page 1 of 1 (latest)

wheat patio
shrewd mason
#

Just curious, how many rps do you get in other express apps in your PC?

wheat patio
wheat patio
shrewd mason
#

I'm no expert but, if this doesn't happen in other routes maybe it's caused by the fetch call in the getUser function?

wheat patio
wheat patio
shrewd mason
#

That's the only thing I had in mind, sorry I couldn't be more helpful

hearty python
#

Can you test on a blank page, taking your code out of the equation?

I assume this is a prod build and not the dev server right?

wheat patio
wheat patio
#

And its just raw express with hello world server

#

but in this case server still working with 6k rps ddos while astro drops at 100

hearty python
#

can you not create an equivalent hello world?

#

or are you saying that's equivalent?

#

I'll create an example, we don't really have benchmarks right now so its possible we have had a regression somewhere along the lines that has made it slower

#

i'll take express out of the equation as that's not really a factor here

#

So this example is not running your auth stuff, right?

#

Thank you for bringing this to our attention @wheat patio

wheat patio
hearty python
#

yeah , i have an example now

#

similar to that

wheat patio
hearty python
#

There's nothing you can do to work around it, seems to be a problem with our code

#

i have some ideas of what it might be and am investigating

graceful tartan
#

i have the same issue, use deno instead and it's at least 10x faster

hearty python
#

we can make it faster

wheat patio
#

but its on npm run preview, im not sure that its exactly what gonna be in prod

graceful tartan
#

cloudflare wrangler is also faster in preview, but not as fast as deno, Node is seriously off

sterile latch
#

I have faith that Matthew can figure this out, 🙏

wheat patio
#

i did a little research and found that maximum rps for deno with astro is around 5k which is not really much

#

and deno itself not seems like a good perfomance tihing

sterile latch
#

Hi @wheat patio could you share your research with us, if possible,

wheat patio
sterile latch
#

interesting, im sure we could reproduce those steps,

wheat patio
#

its a fork of original wrk with py script to run multiple windows

hearty python
#
#

we are spending a lot of time in promises, unfortunately

#

I'm seeing around ~10k in my testing using a similar setup with an Astro hello world

hearty python
#

We can help by reducing the use of async iterables in the rendering pipeline, added almost 1k r/sec in my testing

#

but the biggest gain would be by removing async functions in the pipeline and using callbacks instead

sterile latch
#

that sounds like some considerable effort,

wheat patio
#

so what should i do? its still around 60 rps for me on astro hello world with express

#

i guess it could be better with deno but this happens

hearty python
#

Are you seeing this problem on your actual servers or just locally on your windows computer?

#

60 rps is indeed very slow but I'm not seeing that, or anything close to it. One thing is that Astro creates more objects and uses more memory than a plain express app, is it possible that your computer is memory constrained?

graceful tartan
#

i have plenty of memory left i see it on a linux box. Like awaken i have some issues with i18next that only works with node (only SSR they support for now as per doc) .

  • basic almost static page : DENO 4 ms | NODE 60 ms
  • API call & render 50 cards : DENO 40 ms | NODE 1.3 s (express doesn't deflate by default so data returned is much bigger, but wait time from node is 1s)
hearty python
#

Got another report. I think I know what is causing it. Will submit a fix this upcoming week

hearty python
hearty python
#

Just released 1.4.3 with this change which improves in some projects. Curious to hear if it helps for you.

silent ledge
#

Hi @all. This issue was fixed in the latest version (1.4.4). For my use-cases it fixed HTML rendering/generating times from 500-800ms to 10-20ms 🙂 https://github.com/withastro/astro/issues/4958

Thank you @hearty python 👍

GitHub

What version of astro are you using? 1.4.2 Are you using an SSR adapter? If so, which one? Node What package manager are you using? npm What operating system are you using? Windows 11 Describe the ...

sterile latch
#

[resolved] performance seems low