DaniilSokolyuk / NodeReact.NET

Library to render React library components on the server-side with C# as well as on the client.
MIT License
44 stars 6 forks source link

Reduce allocations #3

Closed DaniilSokolyuk closed 4 years ago

DaniilSokolyuk commented 4 years ago

Now used System.Text.Json in HttpNodeJSService and custom converter for IMemoryOwner Before

Method Mean Error StdDev Median Gen 0 Gen 1 Gen 2 Allocated
NodeReact_RenderRouterSingle 26.34 ms 0.753 ms 2.173 ms 26.17 ms - - - 2097.53 KB
NodeReact_RenderSingle 25.63 ms 0.768 ms 2.216 ms 25.37 ms - - - 1262.37 KB
ZeroReact_RenderSingle 50.80 ms 2.594 ms 7.316 ms 50.28 ms - - - 4.73 KB
ZeroReact_RenderRouterSingle 52.67 ms 1.792 ms 4.994 ms 51.27 ms - - - 7.4 KB
ReactJs_RenderSingle 54.38 ms 1.899 ms 5.599 ms 54.82 ms - - - 1305.15 KB

After

Method Mean Error StdDev Median Gen 0 Gen 1 Gen 2 Allocated
NodeReact_RenderRouterSingle 25.79 ms 0.847 ms 2.472 ms 25.62 ms - - - 10.09 KB
NodeReact_RenderSingle 25.91 ms 0.745 ms 2.149 ms 25.63 ms - - - 10.38 KB
ZeroReact_RenderSingle 50.92 ms 2.717 ms 7.707 ms 49.87 ms - - - 4.73 KB
ZeroReact_RenderRouterSingle 53.73 ms 2.254 ms 6.393 ms 51.96 ms - - - 7.4 KB
ReactJs_RenderSingle 55.61 ms 1.890 ms 5.571 ms 56.25 ms - - - 1305.15 KB

@JeremyTCD