mrpmorris/Fluxor

Fluxor Redux Dev Tools eating ram

pmunozroa opened this issue · 5 comments

Hello, I have been working with Fluxor this week, and just testing my app today, I was in panic when I saw the resources used by the applicaiton, then I check each change that I made, finally I found out it was DevTools, Framework and nuget used:
.NET 7
Fluxor Version="5.9.1"
Fluxor.Blazor.Web Version="5.9.1"
Fluxor.Blazor.Web.ReduxDevTools Version="5.9.1"
Newtonsoft.Jso" Version="13.0.2"
Radzen.Blazor Version="4.20.0"
I tried to take a snapshot, but for some reason, it was crashing
image

Hona commented

Hey, I had similar problems, but mainly with how long it took to blur from a field (approaching 800ms for a simple state update)

Dev Tools is the culprut. 2 main causes, the stack trace & the json serialiser.

Make sure you have the following as I have and let me know if it works:

options.UseReduxDevTools(rdt =>
{
    // Not sure if this one is needed
    rdt.Latency = TimeSpan.FromSeconds(1); // Default 50, maybe improves dev tool perf
    
    rdt.UseSystemTextJson(_ =>
	    new System.Text.Json.JsonSerializerOptions
	    {
		    PropertyNamingPolicy = System.Text.Json.JsonNamingPolicy.CamelCase
	    }
    );
    //rdt.EnableStackTrace();
});
Hona commented

Okay I did more testing. You can keep the stack trace & default Latency. STJ is the only change needed for my perf fix.

Changing the PropertyNamingPolicy sped it up?

Hona commented

In my Blazor app there was a massive slowdown with default dev tool settings or explicitly saying use Newtonsoft.

When I changed the serialised to use SystemTextJson it went away. The naming policy is just extra.

Only STJ is supported as of V6