OPCFoundation / UA-.NETStandard

OPC Unified Architecture .NET Standard
Other
1.97k stars 950 forks source link

Hot path improvements for JSON encoder, skip escaping in DataValue if… #2853

Closed mregen closed 16 hours ago

mregen commented 20 hours ago

Proposed changes

… known constant fieldnames are encoded.

EscapeUri shows up in the hot path analysis when many DataValues are encoded. Bypass the escape function for known constant field values helps to reduce unnecessary escape calls.

Types of changes

What types of changes does your code introduce? Put an x in the boxes that apply. You can also fill these out after creating the PR.

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

codecov[bot] commented 20 hours ago

Codecov Report

Attention: Patch coverage is 91.30435% with 4 lines in your changes missing coverage. Please review.

Project coverage is 54.93%. Comparing base (76b5318) to head (9624390).

Files with missing lines Patch % Lines
Stack/Opc.Ua.Core/Types/Encoders/JsonEncoder.cs 91.30% 3 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop/main374 #2853 +/- ## =================================================== + Coverage 54.88% 54.93% +0.05% =================================================== Files 349 349 Lines 66129 66148 +19 Branches 13576 13581 +5 =================================================== + Hits 36295 36340 +45 + Misses 25872 25849 -23 + Partials 3962 3959 -3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: