Replies: 6 comments
-
Hello @scambier! One of the current focuses of Boa is to improve the API and fulfill the use cases of out users, so all feedback is welcome. I'm glad to see that you were able to use Boa directly for your project, but feel free to report any rough edges you might have found. On the performance side, there are multiple things to it. First, I don't have access to the code, so it's difficult to give a different answer. If the Rust version is doing computation on native code, then that would explain why it's so much faster. On the difference with TIC-80, I'm not aware on how does it work to allow JavaScript in the engine. Does it somehow pre-compile it? Does it have a full JavaScript engine embedded with it? I can talk a bit on Boa's performance. Until now, we have been mostly working on "making it work", which means that our time has been mostly spent on getting an engine that can actually run proper JavaScript (getting the spec right), and not so much on performance. We have made some performance changes, of course, and it's slowly improving. We have some issues open where we have found room for performance optimizations. Nevertheless, since the effort of getting the spec covered is currently taking us most of our effort, I cannot give you estimates on when will we be able to improve the performance of the engine, or how much will it improve. Note that a fast engine that is not conformant is, from our perspective, worse than a conformant and slower engine. In any case, it would be very good to get some performance numbers from your code. Would it be possible for you to run the commands in the profiling documentation to see where is the engine spending time in your case? We might be able to find bottlenecks we don't know about, and even improve the engine for your particular use case. |
Beta Was this translation helpful? Give feedback.
-
Thanks for that answer!
It uses Duktape, but I didn't dig the internals for more more details.
I totally agree with this sentiment. I mean, if Boa isn't fast enough for this very particular usecase, fair enough. Embedding JS in Rust to make games is not really common :p
I tried running the profiler, but something isn't working as it should $ summarize summarize .\my_trace.mm_profdata
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', decodeme\src\lib.rs:117:26
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
$ crox .\my_trace.mm_profdata
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', decodeme\src\lib.rs:117:67
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace I'm on Windows, if that matters. So, if you'd like to take a look at my project, I just uploaded it here: https://github.com/scambier/sim-engine. It's obviously in a rough state, but you should be able to start the benchmark without any issue. The parts related to boa are here and here. Thanks! |
Beta Was this translation helpful? Give feedback.
-
@scambier Did you ever solved those panics? I am having a similar issue now. |
Beta Was this translation helpful? Give feedback.
-
@ItsEthra no sorry :/ And I haven't tried it since |
Beta Was this translation helpful? Give feedback.
-
15 months later, a small update on the numbers, on the same computer
So, for this synthetic benchmark, the performances of Boa have nearly doubled 🙌 |
Beta Was this translation helpful? Give feedback.
-
Small but steady steps. We'll get there eventually :) |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm building a small game engine for myself - think something between Love2D and TIC-80 - and reviewed a few scripting languages. I'd love to use Boa because it would allow me to use TypeScript and easily distribute my games for the web. I made a small PoC that's doing fine, except that performances are very underwhelming.
I wrote small benchmark that spawns bouncing rectangles until I reach 50fps, and compared results between Boa, Rust, and TIC-80 (that uses Duktape as its JS engine):
Now it's not impossible that I made some obvious mistake while implementing Boa, but even then, a 10:1 difference against a similar project is surprising.
Are there long-term improvements planned for performances?
Beta Was this translation helpful? Give feedback.
All reactions