Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmarks #20

Closed
Tracked by #1
SebastianStehle opened this issue Mar 13, 2022 · 3 comments · Fixed by #57
Closed
Tracked by #1

Benchmarks #20

SebastianStehle opened this issue Mar 13, 2022 · 3 comments · Fixed by #57

Comments

@SebastianStehle
Copy link
Owner

No description provided.

@SebastianStehle SebastianStehle mentioned this issue Mar 13, 2022
43 tasks
@LiamRiddell
Copy link
Collaborator

LiamRiddell commented Mar 18, 2022

I ran some performance tests locally using BenchmarkDotNet. Here's the results in Release mode.

Mean : Arithmetic mean of all measurements
Error : Half of 99.9% confidence interval
StdDev : Standard deviation of all measurements
Median : Value separating the higher half of all measurements (50th percentile)
1 us : 1 Microsecond (0.000001 sec)

MJML.NET v1 - Austin

Method Mean Error StdDev
TryParseDocument 37.64 ms 2.538 ms 7.483 ms
ParseDocument 38.77 ms 2.549 ms 7.515 ms
ParseDocumentAsync 38.24 ms 2.157 ms 6.360 ms

MJML.NET v2

Method Mean Error StdDev Median
Render_Template_Amario_Beautified 1,170.1 us 52.85 us 154.18 us 1,103.5 us
Render_Template_Amario_Minified 1,065.5 us 21.23 us 54.03 us 1,053.5 us
Render_Template_ManyHeroes_Beautified 780.1 us 8.21 us 7.27 us 779.2 us
Render_Template_ManyHeroes_Minified 771.8 us 10.07 us 9.42 us 772.7 us

MJML.NET v2 - Multiple Templates

BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1586 (21H1/May2021Update)
Intel Core i7-4790 CPU 3.60GHz (Haswell), 1 CPU, 8 logical and 4 physical cores
.NET SDK=6.0.101
[Host] : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT
DefaultJob : .NET 6.0.1 (6.0.121.56705), X64 RyuJIT

Method Mean Error StdDev Median
Render_Template_Amario_Beautified 972.9 us 9.83 us 8.72 us 970.5 us
Render_Template_Amario_Minified 1,008.0 us 20.09 us 41.49 us 1,001.5 us
Render_Template_Austin_Beautified 332.7 us 6.61 us 17.06 us 327.4 us
Render_Template_Austin_Minified 355.7 us 8.50 us 25.08 us 353.0 us
Render_Template_Sphero_Beautified NA NA NA NA
Render_Template_Sphero_Minified NA NA NA NA

Sphero Failed to Compile. I'm gonna look into this.

@SebastianStehle
Copy link
Owner Author

SebastianStehle commented Mar 18, 2022

Nice :) ... I hope you are going to push that ;)

I have analyzed that with dotTrace, but the majority of time is spent with the StringBuilder. No idea how to optimize this further.

@LiamRiddell LiamRiddell mentioned this issue Mar 19, 2022
@LiamRiddell
Copy link
Collaborator

Nice :) ... I hope you are going to push that ;)

I have analyzed that with dotTrace, but the majority of time is spent with the StringBuilder. No idea how to optimize this further.

I've created PR now. I'm gonna create new branch for the xml entity issue.

@LiamRiddell LiamRiddell linked a pull request Mar 19, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants