Open danthegoodman1 opened 1 month ago
FWIW Goja 1,000x is still fast: Goja multiply in 611.375µs result: 4995
and I've seen it as low as 457.5µs
Goja seems like the obvious choice here, it should add negligible time to requests
Goja's docs aren't great but a lot of it can be interpreted from Otto's docs (e.g. vm.Set
was effectively the same)
See https://github.com/dop251/goja/discussions/586 comparing to rust as well for booting an isolate
A configured option for a route is to handle with JS (like cloudflare workers).
This could be used for adding simple tranformations to requests, enriching from an API, auth, or dropping it.
Goja seems to be massively faster than otto:
Ran twice each:
When binding a simply multiply function from go and calling in JS:
This seems to just be creation time, running it 100 times:
Otto can't even do a simple