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

Need help in understanding performance #6

Closed
xtroncode opened this issue Oct 1, 2020 · 4 comments
Closed

Need help in understanding performance #6

xtroncode opened this issue Oct 1, 2020 · 4 comments

Comments

@xtroncode
Copy link

Hi,
We were planning to move our dotnet core application that renders react on the server using ReactJS.Net to linux, for which we switched from using JavaScriptEngineSwitcher.V8 to JavaScriptEngineSwitcher.ChakraCore but were facing some issues with ChakraCore.

So as per @Taritsyn 's suggestion We tried out JavaScriptEngineSwitcher.Node . While JavaScriptEngineSwitcher.Node is working fine on linux, the performance when compared to JavaScriptEngineSwitcher.V8 is not good (p50 of ~90ms on V8 vs p50 of ~160ms on Node) for rendering our webpages.

We are unable to use NodeReact.NET due to #5 .

As per this the above observation is correct but the benchmarks provided in NodeReact.NET prove otherwise that better performance can be achieved with Node.

I would like to understand why NodeReact.NET has better performance than ReactJS.Net + JavaScriptEngineSwitcher.Node. Is it because of using workerpool ? or something else.

Thanks.

@DaniilSokolyuk
Copy link
Owner

DaniilSokolyuk commented Oct 27, 2020

@xtroncode Hi, sorry for the late reply, NodeReact.NET has better performance because it fully async and managed thread can do other work and not wait for the render, also i am reuse allocated memory which causes much fewer garbage collections. Also it uses node.js (out of process) with worker threads, rendering is cpu bound operation and it helps

@DaniilSokolyuk
Copy link
Owner

DaniilSokolyuk commented Oct 27, 2020

I will do #5 when i have vacation. But when using render functions, performance can drop significantly because it will require much more allocation

@xtroncode
Copy link
Author

Hi @DaniilSokolyuk , Thanks for the reply.
We have already started using JavaScriptEngineSwitcher.Node and are able to get an equivalent performance to V8 . The metrics metioned in my question are incorrect, I had later figured out an issue in my environment which was causing high render times.
Thanks again.

@DaniilSokolyuk
Copy link
Owner

@xtroncode main problem in ReactJS.NET +JavaScriptEngineSwitcher.Node is not performance, main problem is sync call JavaScriptEngineSwitcher.Node and threadpool starvation

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

No branches or pull requests

2 participants