Comment by IshKebab

10 hours ago

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.

  • What about people who want performance somewhere in the middle? There is clearly value in knowing the performance difference.

    • I'm not saying that there would be no value in having benchmarks which compare the JITless, easily embeddable JS interpreters against JITed, hard-to-embed browser-quality JS engines like V8 and SpiderMonkey. I'm just saying that those engines aren't really Boa's competitors, certainly not its "main competitors"; it's a different kind of thing that serves a different need.

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(())
    }

  • Huh, I just noticed thanks to this that the comment needs to be updated in the example lol it should probably say "Parse and evaluate the source code".

  • Oh my god, that's so easy to embed.

    I have to check this out.

    This is awesome. You literally just sold me on it.

  • > anywhere between 2-1000x performance depending on the exact code it's jitting

    That is useful information! Benchmarks can show you this useful information.

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?