Hi!
I'm using the Square SDK in my application, where the boot time of the application is quite sensitive to latency (because of autoscaling).
When profiling the boot time, I've noticed that requiring the Square SDK takes up 20% of the time, which equates to ~600ms (!) locally on my Macbook Air M3. I can't currently get the numbers from production, but I imagine it's even slower in wall time, especially with slower CPUs than my local machine.
Of that, 7% is square/api/index.js, 12% is square/serialization/index.js (mostly square/serialization/types/index.js) and 1% is square/Client.js:
My code only contains the import: import { SquareClient, SquareEnvironment } from 'square', but I cannot seemingly import from sub-packages. I've also noticed that the README section about sub-package exports was recently removed, which I previously tried but couldn't get it to work: https://github.com/square/square-nodejs-sdk/pull/236/changes#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5
What would you recommend here? Or can you allow sub-package exports for lighter imports?
Hi!
I'm using the Square SDK in my application, where the boot time of the application is quite sensitive to latency (because of autoscaling).
When profiling the boot time, I've noticed that requiring the Square SDK takes up 20% of the time, which equates to ~600ms (!) locally on my Macbook Air M3. I can't currently get the numbers from production, but I imagine it's even slower in wall time, especially with slower CPUs than my local machine.
Of that, 7% is
square/api/index.js, 12% issquare/serialization/index.js(mostlysquare/serialization/types/index.js) and 1% issquare/Client.js:My code only contains the import:
import { SquareClient, SquareEnvironment } from 'square', but I cannot seemingly import from sub-packages. I've also noticed that the README section about sub-package exports was recently removed, which I previously tried but couldn't get it to work: https://github.com/square/square-nodejs-sdk/pull/236/changes#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5What would you recommend here? Or can you allow sub-package exports for lighter imports?