-
-
Notifications
You must be signed in to change notification settings - Fork 277
Benchmarking JSON v2 #209
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
base: master
Are you sure you want to change the base?
Benchmarking JSON v2 #209
Conversation
…lable types * Changed return type of `DeserializeLenient<T>` methods to `T?` for better null handling. * Improved handling of JSON input by adding checks for empty or whitespace strings. * Enhanced UTF-8 and UTF-16 decoding paths for more robust JSON processing. * Added helper methods to streamline BOM trimming and single-quote detection.
* Introduced `JsonAssert.AreEqual` method to canonicalize and compare JSON strings. * Updated tests to utilize `JsonAssert` for improved readability and maintainability. * Refactored `DsiJson` to include separate options for reading and writing JSON. * Added `DsiJsonContext` for source-generated serialization options.
|
I was about to release a new version, but your previous PR has broken dependencies, requiring a newer version of |
try putting this in PowerShell module - this is my drop-in for assembly issues and conflicts resolver for PS 5.1, it works for me 99% of times when i deal with dependency problems and conflicts. For PS 7 there's ALC, but that's probably non-issue in PS 7 for now, but for reference: https://github.com/jborean93/PowerShell-ALC Alternatively: For PS 5.1, but that would probably require some JSON changes, and not really great idea. Another idea would be to use Newtonsoft for PS 5.1 as it's pretty much used by PowerShell itself, and use STJ in PS 7+ |
|
I "jiggled" a little with dependency versions and it just started to work. But I am afraid that sooner or later, I will need to use the |
|
I use this code in like 30 of my modules that have heavy dependency issues and conflicts. Never fails for PS 5.1 :-) Saves my ass every time and some of my projects have really like 10 dependencies, different projects even within my project sometimes conflicting. PS is dependency mess. And then other people release their own versions or like Microsoft - Microsoft.Identity.dll is in 3-4 different versions Exchange, Graph, Azure, has each their own version and of course it conflicts out ;) So the code is pretty safe to use. |
|
Yes. Every time I want to demo Microsoft Graph PowerShell to someone, I end up with some assemblies not loading and having to update all modules. So even MSFT is unable to solve this. Do you remember when .NET Framework was introduced 20+ years ago? One of the key features was "solving DLL hell". |
Here's a second version after updates that required some changes to tests as the differences of semantic JSON parsing
Benchmark Comparison – Original vs New vs Final
⏱️ Throughput (ns)
🧠 Allocations
Reduction vs Original (Final):
✅ Key Takeaways
🚀 Final