jelmervdl / translatelocally-web-ext

TranslateLocally for the Browser is a web-extension that enables client side in-page translations for web browsers.
https://addons.mozilla.org/en-GB/firefox/addon/translatelocally-for-firefox/
Mozilla Public License 2.0
66 stars 3 forks source link

Benchmark #19

Closed jelmervdl closed 2 years ago

jelmervdl commented 2 years ago

Adds a benchmarking page to the extension, as an "easy" way to get some numbers. Having the benchmarking page in the extension is not entirely necessary, but since development of upstream stuff is the raison d'être of this thing, might as well maintain it. It does give more finegrained control over performance tuning, so that's cool.

image

Tested on Firefox Nightly 102, 2019 Macbook 16” 2.3 GHz 8-core (but only 4 used in test) Intel i9, 5 runs per scenario

Test set: recored-pages(2).xml.zip which is me browsing German Wikipedia and Der Spiegel for a bit.

Its hardcoded to de-en and it does not check whether it is using the same models. But it is getting the models from the same TranslateLocally repository, and it has the same heuristic as TranslateLocally: locally is preferred, then tiny is preferred.

In the addon options, you can turn on "developer mode" (or whatever I called it). This then adds a "record translation requests" toggle in the translation popup. When you tick that, it will start recording all translation requests from that point on. You can click the "Export xml" link next to the checkbox to get the recording. This also clears the recorder again.

Then, also in the addon settings, there is a link to the benchmark page. Upload the recording you just downloaded there, and you can run it on multiple scenarios.

jelmervdl commented 2 years ago

TranslateLocally benchmarking depends on https://github.com/XapaJIaMnu/translateLocally/pull/103