Skip to content

Performance ​

Both libraries translate the same resources (tests/I18Next.Net.Benchmarks/locales) with the same scenarios. The .NET numbers are the mean of BenchmarkDotNet 0.15.8, the Node.js numbers the median of a batched timing loop after warm-up (tests/I18Next.Net.Benchmarks/node). Measured on an Intel Xeon 2.10 GHz with 4 cores, Ubuntu 24.04.

Scenarioi18next 26.4.2 on Node 22I18Next.Net on .NET 8I18Next.Net on .NET 10Allocated on .NET 10Faster than i18next
Simple key t("simple")3,244 ns221 ns141 ns112 B23×
Nested key t("deep.nested.key")2,862 ns218 ns141 ns112 B20×
Interpolation3,447 ns447 ns328 ns352 B11×
Three interpolations4,133 ns642 ns447 ns424 B9×
Plural4,888 ns580 ns420 ns536 B12×
Context and plural5,100 ns698 ns494 ns656 B10×
Nesting $t(...)6,553 ns1,035 ns750 ns1240 B9×
number format5,505 ns819 ns600 ns464 B9×
Fallback language4,167 ns462 ns306 ns328 B14×
Other namespace2,949 ns249 ns160 ns184 B18×
returnObjects / TObject17,541 ns1,551 ns1,136 ns2120 B15×
Missing key4,664 ns370 ns273 ns352 B17×

Loaded namespaces are resolved synchronously, the arguments of anonymous objects are read with compiled getters, interpolation runs in a single pass and parsed formats are cached.

dotnet run -c Release --project tests/I18Next.Net.Benchmarks -- --filter '*'

cd tests/I18Next.Net.Benchmarks/node
npm install
npm run bench

Released under the Apache License 2.0.