-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Benchmarks and performance data? #2
Comments
I used octane 2.0, some of the long running tc39 tests (specifically this and this). Haven't had time to prepare the results in a publishable form, sorry. |
Still haven't had the time to prepare results? Would really love to see how it stacks up against Otto and V8... how much slow it is at least compared to V8 in simple tests. |
otto parallel test goja parallel test benchmark otto Box2D 89.3 benchmark goja Box2D 509 https://github.com/sokolovstas/fun/tree/master/go_javascript |
How does it compare to Duktape wrappers, e.g. go-duktape? |
@aidansteele it should be pretty interesting 'cause cgo adds 100ns overhead on each call |
If anyone's still wondering, I ran a quick test just out of curiosity about how "go" javascript engine implementations compare. I ran the following code a couple times:
The execution times roughly were: It definitely isn't a real benchmark, and you won't really see the above lines in a real javascript code (well unless you need to calculate 10! 10^6 times for some reason 😄 ), but it should give an idea. |
@tamasf97 out of curiosity, which v8 go binding package did you use? It's quite hard to find bindings that are not outdated/abandoned… |
@tisba I don't have any of these anymore, but I'm almost certain it was this https://github.com/augustoroman/v8 . At least I remember the installation steps mentioning getting a compiled v8 from a ruby gem. Right now I don't believe there's any "proper" v8 binding around, as almost no one is interested enough in using v8 with Go from what I've seen. |
That's too bad :( Efficient scripting support for a "static" language like Go is really nice and useful. Although I'm quite new to the ecosystem, my observation is quite similar (many, apparently abandoned projects). |
About "goroutine safety", is it due to a JS implementation constraint? I don't understand why every JS VM has this and cannot be used concurrently using distinct execution contexts. |
Currently Runtime is the execution context. It has an associated VM which has stacks and other associated state, there is no way a VM could be used concurrently. Another issue is that all Object values are backed by go maps which are also not goroutine-safe. Hope that explains. |
Besides, even if above problems were somehow solved, ECMAScript is designed to be single-threaded, there is no synchronisation mechanism and most built-in functions would break if there were concurrent modifications. |
A thought on this, couldn't the maps be mutex guarded or sync.Maps internally. Likewise, wouldn't it be possible to provide a Reset method to reset the internal state and allow the user to guard the usage with mutexes like other Go standard lib packages? |
goroutine safety is unnecessary, but context support is significant. #243 |
* REALMC-7452 implement memory usage
* REALMC-7452 implement memory usage
I think you'd get very different results if you ran a small script 100,000 times rather than running a big script 1 time:
|
* REALMC-7452 implement memory usage
* drop command pattern in debugger as it's not very useful * Drop Result in debugger * Unexport StringToLines
* drop command pattern in debugger as it's not very useful * Drop Result in debugger * Unexport StringToLines
I have done some benchmarking today on the effect of reusing |
What benchmark code did you use for this, and what were the exact results?
Nice work so far :)
The text was updated successfully, but these errors were encountered: