LocalizationProvider: Slow performance of ILocalizationProvider.Translate()

During a code profiling session, I found that 36% of the running time is spent on this line: https://github.com/valdisiljuconoks/LocalizationProvider/blob/4c0d66e652f2e75affbfe88ce30e356bbe2e9f7d/common/src/DbLocalizationProvider/LocalizationProvider.cs#L237

The test scenario is a start page with various blocks. Two of these blocks are instances of the same block type, which uses the ILocalizationProvider.Translate<T>() method.

Is there a way to get rid of both serialization and deserialization in that method?

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

@valdisiljuconoks I think I cracked the case on replacing JSON conversion with reflection. It is still rather crude code, and it is not yet benchmarked. But it passes all the unit tests.