← Back to context

Comment by speps

7 hours ago

With projects like this competing against well known massive competitors (eg. the browser JS engines), not seeing their main competitors in a benchmark is a massive red flag to me: https://boajs.dev/benchmarks

Not seeing V8, SpiderMonkey JavaScriptCore is very strange...

This is offering a JS scripting layer in an otherwise Rust project. Performance is nice, but probably not a requirement.

It's an embedded engine for scripting a bigger application. Its main "competitor" would be QuickJS.

Though they aren't really competing on anything as far as I can tell, so maybe calling it a "similar project" is more fitting.

It's not competing with V8, SpiderMonkey and JavaScriptCore.

  • Well, it is, because V8 is definitely an embeddable JS engine. For many people they might want to make a choice between V8 and Boa and for them the performance numbers are important information!

    • People who need an extremely high performance JavaScript engine, where the extra performance is worth using an engine that's hard to embed, has an unstable API, and an absolutely massive unwieldy Google-style C++ code base with all the pain that entails, plus a JIT and all the limitations that entails, JITed V8 is the right choice.

      People who just want to run JavaScript code where performance isn't such a big concern would prefer something like Boa (or the other engines listed on the comparison benchmark page).

      Both have their uses, and their use case is almost entirely non-overlapping. You wouldn't choose Boa for a competitive web browser engine or as the runtime for your back-end server software. You would consider it for a plug-in system, or maybe a game's scripting system.

      2 replies →

    • It isn't, v8 will have anywhere between 2-1000x performance depending on the exact code it's jitting. Boa absolutely destroys v8 here though:

          use boa_engine::{Context, Source, JsResult};
          
          fn main() -> JsResult<()> {
            let js_code = r#"
                let two = 1 + 1;
                let definitely_not_four = two + "2";
          
                definitely_not_four
            "#;
          
            // Instantiate the execution context
            let mut context = Context::default();
          
            // Parse the source code
            let result = context.eval(Source::from_bytes(js_code))?;
          
            println!("{}", result.display());
          
            Ok(())
          }

      3 replies →

    • Is it though? V8 and spider monkey both have jits so performance numbers of the form “wow V8 is vastly faster than any of these other ones!” (similarly for sm). Does that really have any value?

Both SpiderMonkey jitless (sm-jitless) and v8 jitless are on the benchmarks page, if you click the checkboxes you will see them in the graphs.