conficient / BlazorTemplater

A library that generates HTML (e.g. for emails) from Razor Components
Apache License 2.0
146 stars 16 forks source link

Performance tests / comparisons #5

Closed conficient closed 3 years ago

conficient commented 3 years ago

Do some performance tests to see how fast the renderer is. Perhaps compare the same template with Razor-View based templating engines.

conficient commented 3 years ago

I've compared BlazorTemplater v1.1.1 against the RazorTemplating v1.5 library which uses precompiled cshtml views from .NET Core 3.1 + apps.

It's slightly slower than RazorTemplating in .NET Core 3.1 and slightly faster in NET 5.0

Full details from BenchmarkDotNet in the performance branch Notes file

The package size is 17Kb vs 52Kb. BlazorTemplater has the advantage of being able to use templates in .NET Standard 2.0 libraries. I wasn't able to get .cshtml Razor Views to work in anything below .NET Core 3.1