Hi Adil. Thanks for the great work, this article has been very useful. Would like to share some experience with you, I've been using goja to run js code in go in a very similar way you do. The problem is that per the documentation we need one goja cxt per go routine, right?. We are receiving tons of requests and hence creating tons of instances of the goja context. This seems to be causing a very high memory consumption (testing without goja for the same number of requests is fine) .
Hi Adil. Thanks for the great work, this article has been very useful. Would like to share some experience with you, I've been using goja to run js code in go in a very similar way you do. The problem is that per the documentation we need one goja cxt per go routine, right?. We are receiving tons of requests and hence creating tons of instances of the goja context. This seems to be causing a very high memory consumption (testing without goja for the same number of requests is fine) .
Have you faced a similar issue?
Regards.
Hi Spardamex, thanks for the feedback. Have you tried using sync.Pool https://pkg.go.dev/sync#Pool ?