Skip to content

Add helper for object creation from JSON string#430

Merged
Anilm3 merged 5 commits into
masterfrom
anilm3/object-to-json-helper
Jul 23, 2025
Merged

Add helper for object creation from JSON string#430
Anilm3 merged 5 commits into
masterfrom
anilm3/object-to-json-helper

Conversation

@Anilm3

@Anilm3 Anilm3 commented Jul 22, 2025

Copy link
Copy Markdown
Collaborator

This PR adds a new helper for object creation from a JSON string, taking advantage of the recently introduced JSON parser. This can be used to speed up the generation of configurations either at startup or on updates.

The new function signature is the following:

bool ddwaf_object_from_json(ddwaf_object *output, const char *json_str, uint32_t length);

@codecov-commenter

codecov-commenter commented Jul 22, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 85.32%. Comparing base (3905751) to head (34fe167).

Files with missing lines Patch % Lines
src/object.cpp 71.42% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #430      +/-   ##
==========================================
- Coverage   85.33%   85.32%   -0.02%     
==========================================
  Files         175      175              
  Lines        8946     8953       +7     
  Branches     3924     3926       +2     
==========================================
+ Hits         7634     7639       +5     
- Misses        504      506       +2     
  Partials      808      808              
Flag Coverage Δ
waf_test 85.32% <71.42%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 22, 2025

Copy link
Copy Markdown

Artifact Size Comparison 📦

Artifact Previous Release This PR Difference
darwin-arm64::libddwaf.a 83315344 83316416 0.00%
darwin-arm64::libddwaf.a.stripped 4352184 4352656 0.00%
darwin-arm64::libddwaf.dylib 1919536 1919600 0.00%
darwin-universal::libddwaf.a 167911160 167913288 0.00%
darwin-universal::libddwaf.a.stripped 9268592 9269640 0.00%
darwin-universal::libddwaf.dylib 4033072 4033136 0.00%
darwin-x86_64::libddwaf.a 84595768 84596824 0.00%
darwin-x86_64::libddwaf.a.stripped 4916360 4916936 0.00%
darwin-x86_64::libddwaf.dylib 2091048 2091112 0.00%
linux-aarch64::libddwaf.a 68876962 69586114 0.01%
linux-aarch64::libddwaf.a.stripped 11720766 11422502 -0.02%
linux-aarch64::libddwaf.so 2429048 2421584 0.00%
linux-armv7::libddwaf.a 60213732 61380942 0.01%
linux-armv7::libddwaf.a.stripped 10612116 10425886 -0.01%
linux-armv7::libddwaf.so 2103320 2098320 0.00%
linux-i386::libddwaf.a 58414994 59673532 0.02%
linux-i386::libddwaf.a.stripped 9009642 9013276 0.00%
linux-i386::libddwaf.so 2302460 2333496 0.01%
linux-x86_64::libddwaf.a 68977050 70040744 0.01%
linux-x86_64::libddwaf.a.stripped 11389686 11242676 -0.01%
linux-x86_64::libddwaf.so 2602216 2608984 0.00%
windows-win32::ddwaf.dll 3292160 3292160 0.00%
windows-win32::ddwaf.lib 11684 11922 0.02%
windows-win32::ddwaf_static.lib 46934870 46937558 0.00%
windows-x64::ddwaf.dll 4021248 4021248 0.00%
windows-x64::ddwaf.lib 11464 11698 0.02%
windows-x64::ddwaf_static.lib 54410908 54414400 0.00%
windows-x86_64::libddwaf.a 6204034 6204526 0.00%
windows-x86_64::libddwaf.dll 18785618 18785659 0.00%
windows-x86_64::libddwaf.dll.a 31292 31948 0.02%

@pr-commenter

pr-commenter Bot commented Jul 22, 2025

Copy link
Copy Markdown

Benchmarks clang

Benchmark execution time: 2025-07-23 11:28:58

Comparing candidate commit 34fe167 in PR branch anilm3/object-to-json-helper with baseline commit 3905751 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@pr-commenter

pr-commenter Bot commented Jul 22, 2025

Copy link
Copy Markdown

Benchmarks gcc

Benchmark execution time: 2025-07-23 11:29:50

Comparing candidate commit 34fe167 in PR branch anilm3/object-to-json-helper with baseline commit 3905751 in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@pr-commenter

pr-commenter Bot commented Jul 22, 2025

Copy link
Copy Markdown

Benchmarks clang-pgo

Benchmark execution time: 2025-07-22 13:23:31

Comparing candidate commit 2eda66c in PR branch anilm3/object-to-json-helper with baseline commit 8c1cceb in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 1 metrics, 0 unstable metrics.

@Anilm3
Anilm3 marked this pull request as ready for review July 23, 2025 11:09
@Anilm3
Anilm3 requested a review from a team as a code owner July 23, 2025 11:09
@Anilm3
Anilm3 merged commit 8d75cef into master Jul 23, 2025
55 of 56 checks passed
@Anilm3
Anilm3 deleted the anilm3/object-to-json-helper branch July 23, 2025 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants