© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
6 replies
reeeeeee

❔ Optimize Serializing of the List

Currently I do it like this, but is very slow.
var json = JsonConvert.SerializeObject(allUsers, Formatting.None, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore });
var json = JsonConvert.SerializeObject(allUsers, Formatting.None, new JsonSerializerSettings() { ReferenceLoopHandling = ReferenceLoopHandling.Ignore });

The List
allUsers
allUsers
is a list of UserPrincipal and have around 1000 elements. The serialization takes are 90 seconds, which I think its a bit too much for a list like that. Is there any way I can optimize that?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Serilog loses List-object- property values when serializing
C#CC# / help
4y ago
✅ Csharp serializing
C#CC# / help
3y ago
✅ What is DataContractSerializer capable of serializing?
C#CC# / help
3y ago