Windows 10 reached EOS (end of support) on October 14, 2025. For more information, see this article.

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Low performance of NativeMessaging API in Firefox compared to Chromium (dozens of times slower)

更多選項

Description: We have encountered a significant performance issue with NativeMessaging API in Firefox when an extension communicates with a native application.

In scenarios where many objects must be enumerated (e.g., ~458 certificates), Firefox is dozens of times slower than Chromium-based browsers.

Environment:

Firefox (latest stable, reproduced in 2025)

Windows 11 x64

Same machine and same native plugin tested in Chrome, Edge, Yandex Browser

Steps to Reproduce:

Create a WebExtension that communicates with a native application via NativeMessaging.

Perform enumeration of a large number of objects (≈ 450–500).

Measure execution time in Firefox vs Chromium.

Actual results:

Firefox: enumeration of 458 objects takes ~2 min 30 sec

Chromium/Edge/Yandex Browser: enumeration of the same 458 objects takes ~5 sec

Additional tests: Round-trip time (RTT) for a single message:

Firefox: ~73.7 ms

Chromium: ~0.3 ms

Because the extension and the plugin exchange a large number of messages, this performance gap becomes critical.

Expected results: NativeMessaging API in Firefox should perform at a level comparable to Chromium browsers, so that extensions relying on heavy message exchange remain usable.

References: Bug 1288912 – Native messaging performance is extremely poor

Although this bug is marked as resolved, performance testing still shows a major discrepancy in the current versions of Firefox.

Question: Is there any ongoing work or plan to optimize the implementation of NativeMessaging API in Firefox to address this performance issue?

Description: We have encountered a significant performance issue with NativeMessaging API in Firefox when an extension communicates with a native application. In scenarios where many objects must be enumerated (e.g., ~458 certificates), Firefox is dozens of times slower than Chromium-based browsers. Environment: Firefox (latest stable, reproduced in 2025) Windows 11 x64 Same machine and same native plugin tested in Chrome, Edge, Yandex Browser Steps to Reproduce: Create a WebExtension that communicates with a native application via NativeMessaging. Perform enumeration of a large number of objects (≈ 450–500). Measure execution time in Firefox vs Chromium. Actual results: Firefox: enumeration of 458 objects takes ~2 min 30 sec Chromium/Edge/Yandex Browser: enumeration of the same 458 objects takes ~5 sec Additional tests: Round-trip time (RTT) for a single message: Firefox: ~73.7 ms Chromium: ~0.3 ms Because the extension and the plugin exchange a large number of messages, this performance gap becomes critical. Expected results: NativeMessaging API in Firefox should perform at a level comparable to Chromium browsers, so that extensions relying on heavy message exchange remain usable. References: Bug 1288912 – Native messaging performance is extremely poor Although this bug is marked as resolved, performance testing still shows a major discrepancy in the current versions of Firefox. Question: Is there any ongoing work or plan to optimize the implementation of NativeMessaging API in Firefox to address this performance issue?
附加的畫面擷圖

所有回覆 (2)

更多選項

Could you report it on https://bugzilla.mozilla.org ? That old bug is closed.

It would be nice to attach a perf profile to your bug.

Thanks.

更多選項

TyDraniu said

Could you report it on https://bugzilla.mozilla.org ? That old bug is closed. It would be nice to attach a perf profile to your bug. Thanks.

Thank you for your quick response.

I noticed an interesting effect while testing with the profiler:

When I start "Record a performance profile", the enumeration of certificates (≈458 objects) completes much faster — about 1 minute.

When I do not enable profiling, the same operation takes about 5 minutes, as originally reported.

So, enabling performance profiling significantly reduces the delay, which looks unusual. It seems that recording a profile changes the timing/behavior of the NativeMessaging communication in Firefox.

問個問題

如果您還沒有帳號,您必須先登入帳號 來回覆文章。還沒有帳號的話,只能發問新問題