networknt / json-schema-validator

A fast Java JSON schema validator that supports draft V4, V6, V7, V2019-09 and V2020-12
Apache License 2.0
800 stars 320 forks source link

Optimize logging by creating a debug flag #1054

Closed justin-tay closed 3 weeks ago

justin-tay commented 1 month ago

This creates a debugEnabled flag in ExecutionConfig that is checked to determine if the debug logs should be generated. This is a performance optimization as it was noticed during profiling that since this debug function runs very frequently during validation execution the time taken just to determine if the logger is enabled is significant.

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 79.68750% with 13 lines in your changes missing coverage. Please review.

Project coverage is 78.66%. Comparing base (48ca3c2) to head (da43eb8). Report is 23 commits behind head on master.

Files Patch % Lines
...n/java/com/networknt/schema/BaseJsonValidator.java 0.00% 9 Missing and 1 partial :warning:
...ain/java/com/networknt/schema/ExecutionConfig.java 50.00% 2 Missing :warning:
...java/com/networknt/schema/DynamicRefValidator.java 50.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1054 +/- ## ============================================ - Coverage 78.90% 78.66% -0.24% - Complexity 1965 2018 +53 ============================================ Files 172 190 +18 Lines 6352 6526 +174 Branches 1255 1244 -11 ============================================ + Hits 5012 5134 +122 - Misses 867 921 +54 + Partials 473 471 -2 ```

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