Description
Describe the bug
I have a loopback 4 application where I have API which returns large data 500000 records to explain the problem I have added the jaeger trace
if you see 1) is my API which has responded in 7-8 sec but the complete API took 12-13 sec
I want to know what happens in those remaining 5-6 sec?
I debugged the API and found out that the control goes to loopback/rest where it is stringifying the response that too using JSON.stringify() and not asyncrously
what happens is that during this time all other requests goes pending in my case liveliness check goes pending and as per my configuration if liveliness failed the container restarts .
how to fix this problem ?
Logs
No response
Additional information
Can we do a faster stringify?
or maybe make this asynchronous? I am ready to contribute
Reproduction
.