Fluxor icon indicating copy to clipboard operation
Fluxor copied to clipboard

Fluxor Redux Dev Tools eating ram

Open pmunozroa opened this issue 1 year ago • 4 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

pmunozroa avatar Dec 14 '23 21:12 pmunozroa

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 avatar Jan 05 '24 04:01 Hona

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

Hona avatar Jan 05 '24 04:01 Hona

Changing the PropertyNamingPolicy sped it up?

mrpmorris avatar Jan 15 '24 09:01 mrpmorris

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.

Hona avatar Jan 15 '24 23:01 Hona

Only STJ is supported as of V6

mrpmorris avatar Mar 13 '24 22:03 mrpmorris