Description
The Problem
The current Dotnet framework build works great for the purpose. But for large source code with hundreds of .RESX files, the first read takes a few minutes. In my case reading more than 20k entries from a few hundred files takes about 2.5 minutes. As per observation, the subsequent reads are faster and only take a few seconds. However, the first read is more painful for daily use. There is indeed no need to read all RESX files every time, for typical use. However, we do it to reuse the translations from the past. This feature is in our internal copy of the code. The existing translations can be re-used if an exact match is found. The motivation is to avoid the double cost of translations by a third party.
The Solution
Migrating to Dotnet 8 is one potential solution. My collogue tried a PoC with Dotnet 8 and Avalonia UI to check read and render performance. With AOT build the app is blazingly fast, even for the first read. The code is available at https://github.com/sps014/Localizer.
Apart from gaining performance potentially, the tool can become cross-platform by adopting Dotnet 8 and Avalonia UI
The alternatives
In my local copy, I could gain performance benefits with Parallel Foreach, PLINQ, and WPF Async binding. The performance improvement is not as significant as observed in PoC. But this is still can be a good gain with minimal changes.