Closed hfhchan-plb closed 8 months ago
so what's the issue here?
make sure you're using the latest version of @nestjs/core
and @nestjs/common
Sorry I've just updated the minimum reproduction code.
I'm using 10.3.0 which appears to be the latest version.
ok but what's the expected behavior?
that's just an warning message, not an error, right? You can see why it exists in the issue https://github.com/nestjs/nest/issues/12738
I think the expected behavior would be that the TypeORM integration would avoid having a large amount of static data to be serialized?
I would like to find a way to remove that 30 ms extra time per cold start 🤔
I believe that this is a limitation that we cannot circumvent on the nestjs side yet
This can probably be fixed by replacing the useValue with useFactory like the original issue
so please try it out changing the js code of your node_modules/@nestjs/typeorm
dir
Running this locally I'm seeing 0.06 ms - 0.19 ms without the change and 0.07 ms - 0.13 ms with the change with some spikes going up to 1 ms or 2 ms. As I'm using forRootAsync()
the only thing being serialized is generateString()
, which basically just calls uuid
. So it looks like the runtime itself was stalling to produce random values :shrug:
Closing for now.
Is there an existing issue for this?
Current behavior
An error gets logged to the logs:
Minimum reproduction code
Steps to reproduce
No response
Expected behavior
No error
Package version
10.0.1
NestJS version
10.3.0
Node.js version
No response
In which operating systems have you tested?
Other
No response