Skip to content

Commit 4f29d44

Browse files
authored
chore(iast): improve microbenchmarks accuracy [backport 2.21] (#13179)
Backport #13160 to 2.21 - remove `loops` and `value` config from appsec_iast_aspects/config.yaml and use the default values - split `appsec_iast_aspects` into smaller steps due to the default values returns timeout in the CI - Fix exception in `appsec_iast_propagation/scenario.py` ``` File "/app/benchmarks/.venv_baseline/lib/python3.9/site-packages/pyperf/_runner.py", line 494, in task_func return time_func(loops, *args) File "/app/benchmarks/bm/_scenario.py", line 64, in _pyperf run(loops) File "/app/benchmarks/scenario.py", line 99, in _ launch_function(self.iast_enabled, func, self.internal_loop, caller_loop) File "/app/benchmarks/scenario.py", line 81, in launch_function tainted_value = new_request(enable_propagation) File "/app/benchmarks/scenario.py", line 75, in new_request taint_pyobject_with_ranges(tainted, (CHECK_RANGES[0],)) File "/app/benchmarks/scenario.py", line 41, in taint_pyobject_with_ranges set_ranges(pyobject, tuple(ranges)) ValueError: iast::propagation::native::error::Tainted Map isn't initialized Traceback (most recent call last): ``` ## Checklist - [x] PR author has checked that all the criteria below are met - The PR description includes an overview of the change - The PR description articulates the motivation for the change - The change includes tests OR the PR description describes a testing strategy - The PR description notes risks associated with the change, if any - Newly-added code is easy to change - The change follows the [library release note guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html) - The change includes or references documentation updates if necessary - Backport labels are set (if [applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)) ## Reviewer Checklist - [x] Reviewer has checked that all the criteria below are met - Title is accurate - All changes are related to the pull request's stated goal - Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes - Testing strategy adequately addresses listed risks - Newly-added code is easy to change - Release note makes sense to a user of the library - If necessary, author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment - Backport labels are set in a manner that is consistent with the [release branch maintenance policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)
1 parent 888209f commit 4f29d44

File tree

12 files changed

+1635
-328
lines changed

12 files changed

+1635
-328
lines changed

benchmarks/appsec_iast_aspects/config.yaml

Lines changed: 0 additions & 296 deletions
Large diffs are not rendered by default.

benchmarks/appsec_iast_aspects/functions.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,6 @@
2626
"ljust_aspect",
2727
"lower_aspect",
2828
"modulo_aspect",
29-
"ospathbasename_aspect",
30-
"ospathdirname_aspect",
31-
"ospathjoin_aspect",
32-
"ospathnormcase_aspect",
33-
"ospathsplit_aspect",
34-
"ospathsplitdrive_aspect",
35-
"ospathsplitext_aspect",
36-
"re_expand_aspect",
37-
"re_findall_aspect",
38-
"re_finditer_aspect",
39-
"re_fullmatch_aspect",
40-
"re_group_aspect",
41-
"re_groups_aspect",
42-
"re_match_aspect",
43-
"re_search_aspect",
44-
"re_sub_aspect",
45-
"re_subn_aspect",
4629
"replace_aspect",
4730
"repr_aspect",
4831
"rsplit_aspect",
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
ospathbasename_aspect: &ospathbasename_aspect
2+
warmups: 1
3+
function_name: "iast_ospathbasename_aspect"
4+
5+
ospathbasename_noaspect:
6+
<<: *ospathbasename_aspect
7+
function_name: "ospathbasename_noaspect"
8+
9+
ospathdirname_aspect: &ospathdirname_aspect
10+
warmups: 1
11+
function_name: "iast_ospathdirname_aspect"
12+
13+
ospathdirname_noaspect:
14+
<<: *ospathdirname_aspect
15+
function_name: "ospathdirname_noaspect"
16+
17+
ospathjoin_aspect: &ospathjoin_aspect
18+
warmups: 1
19+
function_name: "iast_ospathjoin_aspect"
20+
21+
ospathjoin_noaspect:
22+
<<: *ospathjoin_aspect
23+
function_name: "ospathjoin_noaspect"
24+
25+
ospathnormcase_aspect: &ospathnormcase_aspect
26+
warmups: 1
27+
function_name: "iast_ospathnormcase_aspect"
28+
29+
ospathnormcase_noaspect:
30+
<<: *ospathnormcase_aspect
31+
function_name: "ospathnormcase_noaspect"
32+
33+
ospathsplit_aspect: &ospathsplit_aspect
34+
warmups: 1
35+
function_name: "iast_ospathsplit_aspect"
36+
37+
ospathsplit_noaspect:
38+
<<: *ospathsplit_aspect
39+
function_name: "ospathsplit_noaspect"
40+
41+
ospathsplitdrive_aspect: &ospathsplitdrive_aspect
42+
warmups: 1
43+
function_name: "iast_ospathsplitdrive_aspect"
44+
45+
ospathsplitdrive_noaspect:
46+
<<: *ospathsplitdrive_aspect
47+
function_name: "ospathsplitdrive_noaspect"
48+
49+
ospathsplitext_aspect: &ospathsplitext_aspect
50+
warmups: 1
51+
function_name: "iast_ospathsplitext_aspect"
52+
53+
ospathsplitext_noaspect:
54+
<<: *ospathsplitext_aspect
55+
function_name: "ospathsplitext_noaspect"

0 commit comments

Comments
 (0)