npapifirebreath

Firebreath vs NPAPI performance overhead?


We know that there is a small overhead for Firebreath 2.0 plugins in Chrome because the framework creates a thin PPAPI executable to run the plugin within.

However, for Mozilla and Safari does a Firebreath plugin add any overhead compared to a bare NPAPI plugin?

In our case we are porting the stockfish chess engine to a plugin so the C++ code is very CPU intensive and even a small overhead is significant.


Solution

  • FireBreath 2.0 does not use PPAPI -- PPAPI is not a viable solution for third party plugins because unless used with Native Client the plugin will not be usable unless specifically enabled with a command line parameter each time Chrome is launched.

    FireBreath 2.0 uses Native Messaging and the plugin is loaded in a native message host executable; thus there is no overhead as far as running the C++, but the interface to communicate with the browser uses JSON and is string-based, so there will absolutely be some overhead there.

    Basically it depends on what your concern is -- if you need super high speed communication between the browser and your firebreath plugin you'll need to do some performance testing to see if it's good enough or not. If all you really need is for the C++ code to be just as fast as it was before then no problems -- it's native code, so it's every bit as fast. Your overhead will come whenever you communicate with the browser.