Coder Social home page Coder Social logo

daniilsokolyuk / nodereact.net Goto Github PK

View Code? Open in Web Editor NEW
42.0 7.0 4.0 1.79 MB

Library to render React library components on the server-side with C# as well as on the client.

License: MIT License

JavaScript 18.75% C# 80.29% HTML 0.97%
server-side-rendering react csharp asp-net-core dotnet aspnet javascript dotnet-core reactjs dotnetcore

nodereact.net's People

Contributors

daniilsokolyuk avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nodereact.net's Issues

Performance and scalability

Hi!

Thanks for a truly great and smart package!

I was looking at this package as an alternative to ReactJS.NET since I would like to be able to use React v18 and SSR for things like React.Suspense.

I'm running NodeJS on my machine and I played around with this library to compare, I like the API and it feels really easy to use. However, when I made a simple little comparison for the performance I was a little concerned. I basically had the same application with both libraries and just switched between them to run the test. I know that the test with NodeReact.NET probably should be slower since it handles/renders the content inside a React.Suspense-component and also since it's interop to node, but the throughput was quite low.

I used a simple tool called NetLing to send some requests to the server (was running IIS Express via Visual Studio) and found that:

  • NodeReact.NET served 19 rps with a median load time of 216 ms, while
  • ReactJS.NET served 3017 rps with a median load time of 0,5 ms.

This was done on a quite big machine with an Intel Core i9 12900K processor. I'm wondering if I did something wrong here? Are the numbers too off from what you would expect? Is there anything I can do to improve this? I'm thinking of configuration, set up etc. Is there any settings that would be "preferable" over others? I know that documentation is not the funniest thing to spend time on but I would very much like to try to squeeze as much as possible out of this to know if it would be a viable solution for upcoming projects so it would be valuable to know more about the "recommended" setup.

Once again, thank you very much for sharing the great work done so far!

simple-benchmarks

UPDATE:
I figured I wanted to try this again with only NodeReact.NET and it looks to me that there is something around the threading, when there are more threads hitting the page the RPS goes down maybe this is the interop to NodeJS that has some bottlenecks? It would interesting to see if and how things can be configured for better throughput.

image

*UPDATE AGAIN:
Rookie-mistake on my end. I was hitting the app when it was built in Debug-mode, after switching to Release mode I got a lot better throughput. It's strange that ReactJS.NET performed so much better in Debug mode but these numbers are a lot better than the once I saw in Debug mode.

Sorry for putting on a "false alarm". Maybe this is something that should be mentioned in docs somewhere so that people don't think that the package is slow.

image

Need help in understanding performance

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.

Support for .NET 4 & MUI/Emotion/StyledComponents Workaround?

Are you open to a pull request to add support for .NET Framework 4? I have it started in a POC on my local machine and would be willing to clean it up and submit a PR if it would be considered.

Also im working on workaround support for MUI/Emotion/StyledComponents with the renderToPipeableStream and would like to also see about maybe getting that PR'd in around a feature flag for people to opt-in to add its usage

Examples for usage?

Are there any examples of usage?

Also how would we leverage something like Material UI? Currently I do this using render functions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.