Enabling pnpm makes my build and load times much slower


#1

I created a remix of frogfeels.glitch.me at https://glitch.com/edit/#!/frog-tulip-word . I went into the console and enable pnpm

Observed:

  • the new project takes way longer to build and to load (in the order of 10s of seconds in some cases)

Original:

PNPM enabled:

Expected:

the same speed or faster

Any idea on what’s causing this discrepancy?


#2

I don’t see the build times in your screenshot but it is normal that the first build takes longer with pnpm in some cases. As for the load times, pnpm vs npm is completely independent of how your app runs.

What happens if you enable npm back in your remix? Does it get fast again? Comparing two separate projects might not be great because there might be caches involved etc.

UPDATE: to be more specific, enabling pnpm on a remix of a project that was using npm is going to be slower, because the remix has to recreate node_modules from scratch. If you remix a project that already has pnpm enabled, 99% of the time the install would be instantaneous.

Again, I am pretty sure the load times are completely unrelated. I can try to reproduce when I get the chance. Can you give me the reproduction protocol?


#3

whoops ya i meant load times are the persistent problem

to repro:

  1. remix frogfeels project https://glitch.com/edit/#!/frogfeels
  2. copy env values from original into remix (i’ll dm u an invite link)
  3. open console and enable pnpm
  4. show remixed app and observe load times

#4

btw this is super low priority, feel free to respond after the weekend if u’d prefer


#5

I’ve run some performance tests from my machine, from AWS and using pingdom: none of them highlights any change in performance between using npm and pnpm. As I said earlier, there can’t be difference in load time between using pnpm and npm, it would be very strange if there were.

For reference:

Again, I am pretty sure that the difference you noticed is just due to the browser needing to cache additional resources because the URL of the remix is different.