@eagleoutice/flowr 2.13.13 → 2.13.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -28
- package/abstract-interpretation/data-frame/resolve-args.js +11 -12
- package/benchmark/calibration.d.ts +18 -0
- package/benchmark/calibration.js +63 -0
- package/benchmark/slicer.d.ts +19 -0
- package/benchmark/slicer.js +84 -1
- package/benchmark/stats/feature-counts.d.ts +6 -0
- package/benchmark/stats/feature-counts.js +61 -0
- package/benchmark/stats/print.js +20 -0
- package/benchmark/stats/sigdb-counts.d.ts +7 -0
- package/benchmark/stats/sigdb-counts.js +219 -0
- package/benchmark/stats/size-of.d.ts +6 -0
- package/benchmark/stats/size-of.js +8 -0
- package/benchmark/stats/stats.d.ts +79 -0
- package/benchmark/stats/stats.js +7 -1
- package/benchmark/stopwatch.d.ts +4 -0
- package/benchmark/stopwatch.js +12 -1
- package/benchmark/summarizer/data.d.ts +17 -1
- package/benchmark/summarizer/first-phase/input.js +5 -0
- package/benchmark/summarizer/first-phase/process.js +12 -2
- package/benchmark/summarizer/second-phase/graph.d.ts +24 -1
- package/benchmark/summarizer/second-phase/graph.js +249 -18
- package/benchmark/summarizer/second-phase/process.js +56 -0
- package/benchmark/summarizer/summarizer.js +1 -2
- package/cli/benchmark-app.d.ts +1 -0
- package/cli/benchmark-app.js +2 -1
- package/cli/benchmark-helper-app.d.ts +1 -0
- package/cli/benchmark-helper-app.js +12 -2
- package/cli/common/options.d.ts +10 -0
- package/cli/common/options.js +3 -1
- package/cli/common/scripts-info.d.ts +10 -0
- package/cli/repl/commands/repl-cfg.js +2 -42
- package/cli/repl/commands/repl-clipboard.d.ts +7 -0
- package/cli/repl/commands/repl-clipboard.js +53 -0
- package/cli/repl/commands/repl-dataflow.js +5 -70
- package/cli/repl/commands/repl-normalize.js +3 -51
- package/control-flow/cfg-builder.d.ts +30 -0
- package/control-flow/cfg-builder.js +79 -0
- package/control-flow/cfg-dead-code.js +5 -29
- package/control-flow/diff-cfg.js +2 -56
- package/control-flow/extract-cfg.js +17 -10
- package/control-flow/semantic-cfg-guided-visitor.d.ts +7 -0
- package/control-flow/semantic-cfg-guided-visitor.js +14 -0
- package/control-flow/useless-loop.js +4 -26
- package/core/steps/all/core/10-normalize.d.ts +8 -0
- package/core/steps/all/core/10-normalize.js +10 -8
- package/core/steps/all/core/11-normalize-tree-sitter.d.ts +5 -7
- package/core/steps/all/core/11-normalize-tree-sitter.js +2 -9
- package/data/r-base-packages.generated.d.ts +1 -0
- package/data/r-base-packages.generated.js +5 -3
- package/dataflow/environments/apply-kill.d.ts +3 -3
- package/dataflow/environments/apply-kill.js +60 -31
- package/dataflow/environments/built-in-config.d.ts +9 -1
- package/dataflow/environments/built-in-proc-name.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.js +2 -0
- package/dataflow/environments/built-in-props.d.ts +4 -0
- package/dataflow/environments/built-in-props.js +3 -3
- package/dataflow/environments/built-in.d.ts +4 -2
- package/dataflow/environments/built-in.js +53 -3
- package/dataflow/environments/data-masking-functions.d.ts +3 -4
- package/dataflow/environments/data-masking-functions.js +7 -8
- package/dataflow/environments/default-builtin-config.d.ts +92 -12
- package/dataflow/environments/default-builtin-config.js +86 -43
- package/dataflow/environments/environment.d.ts +5 -0
- package/dataflow/environments/environment.js +17 -12
- package/dataflow/environments/identifier.d.ts +3 -0
- package/dataflow/environments/reference-to-maybe.d.ts +5 -3
- package/dataflow/environments/reference-to-maybe.js +17 -52
- package/dataflow/environments/resolve-helper.d.ts +2 -1
- package/dataflow/environments/resolve-helper.js +2 -1
- package/dataflow/eval/resolve/alias-tracking.js +4 -7
- package/dataflow/eval/resolve/node-value.d.ts +51 -0
- package/dataflow/eval/resolve/node-value.js +71 -0
- package/dataflow/eval/resolve/resolve-argument.js +10 -7
- package/dataflow/eval/resolve/resolve-operators.js +1 -2
- package/dataflow/eval/values/general.d.ts +4 -0
- package/dataflow/eval/values/general.js +11 -0
- package/dataflow/eval/values/r-value.d.ts +15 -0
- package/dataflow/eval/values/r-value.js +27 -1
- package/dataflow/extractor.js +2 -0
- package/dataflow/fn/higher-order-function.js +2 -3
- package/dataflow/graph/df-helper.d.ts +2 -1
- package/dataflow/graph/diff-dataflow-graph.js +3 -55
- package/dataflow/graph/graph.d.ts +5 -0
- package/dataflow/graph/graph.js +27 -0
- package/dataflow/info.d.ts +7 -1
- package/dataflow/info.js +36 -7
- package/dataflow/internal/linker.d.ts +23 -0
- package/dataflow/internal/linker.js +70 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +8 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +39 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +10 -22
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +29 -53
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +33 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +6 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +19 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +69 -52
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +2 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +23 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +7 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +20 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.d.ts +25 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +105 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +9 -28
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +1 -1
- package/dataflow/internal/process/functions/call/deferred.d.ts +41 -0
- package/dataflow/internal/process/functions/call/deferred.js +127 -0
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +13 -12
- package/dataflow/internal/process/functions/call/known-call-handling.js +35 -35
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +8 -4
- package/dataflow/internal/process/functions/call/nse.d.ts +28 -0
- package/dataflow/internal/process/functions/call/nse.js +87 -0
- package/dataflow/internal/process/functions/call/quoted.d.ts +29 -0
- package/dataflow/internal/process/functions/call/quoted.js +188 -0
- package/documentation/doc-readme.js +5 -2
- package/documentation/doc-util/doc-issue.d.ts +2 -0
- package/documentation/doc-util/doc-issue.js +3 -1
- package/documentation/doc-util/doc-types.js +15 -9
- package/documentation/wiki-dataflow-graph.js +4 -0
- package/documentation/wiki-faq.js +6 -2
- package/documentation/wiki-onboarding.js +11 -1
- package/documentation/wiki-setup.js +2 -1
- package/linter/rules/deprecated-functions.js +9 -3
- package/linter/rules/seeded-randomness.js +2 -3
- package/linter/rules/undefined-symbol.js +10 -1
- package/package.json +9 -4
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +6 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +17 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +2 -11
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +3 -15
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.d.ts +16 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.js +26 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +2 -11
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +3 -15
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +4 -10
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +2 -9
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +2 -9
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +1 -1
- package/project/sigdb/reader.d.ts +9 -0
- package/project/sigdb/reader.js +30 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +0 -12
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -37
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +2 -23
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +2 -2
- package/queries/query-function-filter.d.ts +21 -0
- package/queries/query-function-filter.js +48 -0
- package/r-bridge/data/data.d.ts +13 -3
- package/r-bridge/data/data.js +15 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +4 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +11 -9
- package/search/flowr-search-filters.d.ts +5 -1
- package/search/flowr-search-filters.js +31 -21
- package/search/search-executor/search-enrichers.d.ts +24 -4
- package/search/search-executor/search-enrichers.js +22 -9
- package/search/search-executor/search-transformer.js +1 -1
- package/slicing/static/slice-call.js +4 -4
- package/util/diff-graph.d.ts +13 -0
- package/util/diff-graph.js +64 -1
- package/util/files.js +9 -8
- package/util/node-version.d.ts +4 -0
- package/util/node-version.js +29 -0
- package/util/r-base-packages.d.ts +2 -0
- package/util/r-base-packages.js +3 -1
- package/util/version.js +1 -1
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ It offers a wide variety of features, for example:
|
|
|
43
43
|
|
|
44
44
|
```shell
|
|
45
45
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
46
|
-
flowR repl v2.13.
|
|
46
|
+
flowR repl v2.13.14, R grammar v14 (tree-sitter engine)
|
|
47
47
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
48
48
|
```
|
|
49
49
|
|
|
@@ -52,17 +52,17 @@ It offers a wide variety of features, for example:
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
```text
|
|
55
|
-
Query: linter (
|
|
55
|
+
Query: linter (11 ms)
|
|
56
56
|
╰ Deprecated Functions (deprecated-functions): no findings
|
|
57
57
|
╰ File Path Validity (file-path-validity):
|
|
58
58
|
╰ certain:
|
|
59
59
|
╰ Path `/root/x.txt` at 1.1-23
|
|
60
|
-
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
60
|
+
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 1, processTimeMs: 0
|
|
61
61
|
╰ Seeded Randomness (seeded-randomness): no findings
|
|
62
62
|
╰ Absolute Paths (absolute-file-paths):
|
|
63
63
|
╰ certain:
|
|
64
64
|
╰ Path `/root/x.txt` at 1.1-23
|
|
65
|
-
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
65
|
+
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0
|
|
66
66
|
╰ Unused Definitions (unused-definitions): no findings
|
|
67
67
|
╰ Network Functions (network-functions): no findings
|
|
68
68
|
╰ Dataframe Access Validation (dataframe-access-validation): no findings
|
|
@@ -73,7 +73,7 @@ It offers a wide variety of features, for example:
|
|
|
73
73
|
╰ Roxygen Arguments (roxygen-arguments): no findings
|
|
74
74
|
╰ No Leaked Credentials (no-leaked-credentials): no findings
|
|
75
75
|
╰ Undefined Symbol (undefined-symbol): no findings
|
|
76
|
-
All queries together required ≈
|
|
76
|
+
All queries together required ≈11 ms (1ms accuracy, total 11 ms)
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
|
|
@@ -95,7 +95,7 @@ It offers a wide variety of features, for example:
|
|
|
95
95
|
|
|
96
96
|
_Results (prettified and summarized):_
|
|
97
97
|
|
|
98
|
-
Query: **linter** (
|
|
98
|
+
Query: **linter** (3550 ms)\
|
|
99
99
|
╰ **Deprecated Functions** (deprecated-functions): _no findings_\
|
|
100
100
|
╰ **File Path Validity** (file-path-validity):\
|
|
101
101
|
╰ certain:\
|
|
@@ -105,7 +105,7 @@ It offers a wide variety of features, for example:
|
|
|
105
105
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
106
106
|
╰ certain:\
|
|
107
107
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
108
|
-
╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
108
|
+
╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0\
|
|
109
109
|
╰ **Unused Definitions** (unused-definitions): _no findings_\
|
|
110
110
|
╰ **Network Functions** (network-functions): _no findings_\
|
|
111
111
|
╰ **Dataframe Access Validation** (dataframe-access-validation): _no findings_\
|
|
@@ -116,11 +116,11 @@ It offers a wide variety of features, for example:
|
|
|
116
116
|
╰ **Roxygen Arguments** (roxygen-arguments): _no findings_\
|
|
117
117
|
╰ **No Leaked Credentials** (no-leaked-credentials): _no findings_\
|
|
118
118
|
╰ **Undefined Symbol** (undefined-symbol): _no findings_\
|
|
119
|
-
_All queries together required ≈
|
|
119
|
+
_All queries together required ≈3550 ms (1ms accuracy, total 3552 ms)_
|
|
120
120
|
|
|
121
121
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
122
122
|
|
|
123
|
-
The analysis required
|
|
123
|
+
The analysis required _3551.6 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
124
124
|
|
|
125
125
|
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
|
|
126
126
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -138,7 +138,7 @@ It offers a wide variety of features, for example:
|
|
|
138
138
|
"totalCalls": 0,
|
|
139
139
|
"totalFunctionDefinitions": 0,
|
|
140
140
|
"searchTimeMs": 3,
|
|
141
|
-
"processTimeMs":
|
|
141
|
+
"processTimeMs": 3514
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
144
|
"file-path-validity": {
|
|
@@ -172,8 +172,8 @@ It offers a wide variety of features, for example:
|
|
|
172
172
|
"callsWithAssignmentProducers": 0,
|
|
173
173
|
"callsWithNonConstantProducers": 0,
|
|
174
174
|
"callsWithOtherBranchProducers": 0,
|
|
175
|
-
"searchTimeMs":
|
|
176
|
-
"processTimeMs":
|
|
175
|
+
"searchTimeMs": 2,
|
|
176
|
+
"processTimeMs": 0
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
"absolute-file-paths": {
|
|
@@ -192,7 +192,7 @@ It offers a wide variety of features, for example:
|
|
|
192
192
|
".meta": {
|
|
193
193
|
"totalConsidered": 1,
|
|
194
194
|
"totalUnknown": 0,
|
|
195
|
-
"searchTimeMs":
|
|
195
|
+
"searchTimeMs": 1,
|
|
196
196
|
"processTimeMs": 0
|
|
197
197
|
}
|
|
198
198
|
},
|
|
@@ -201,7 +201,7 @@ It offers a wide variety of features, for example:
|
|
|
201
201
|
".meta": {
|
|
202
202
|
"totalConsidered": 0,
|
|
203
203
|
"searchTimeMs": 0,
|
|
204
|
-
"processTimeMs":
|
|
204
|
+
"processTimeMs": 1
|
|
205
205
|
}
|
|
206
206
|
},
|
|
207
207
|
"network-functions": {
|
|
@@ -209,7 +209,7 @@ It offers a wide variety of features, for example:
|
|
|
209
209
|
".meta": {
|
|
210
210
|
"totalCalls": 0,
|
|
211
211
|
"totalFunctionDefinitions": 0,
|
|
212
|
-
"searchTimeMs":
|
|
212
|
+
"searchTimeMs": 1,
|
|
213
213
|
"processTimeMs": 1
|
|
214
214
|
}
|
|
215
215
|
},
|
|
@@ -220,7 +220,7 @@ It offers a wide variety of features, for example:
|
|
|
220
220
|
"numAccesses": 0,
|
|
221
221
|
"totalAccessed": 0,
|
|
222
222
|
"searchTimeMs": 0,
|
|
223
|
-
"processTimeMs":
|
|
223
|
+
"processTimeMs": 2
|
|
224
224
|
}
|
|
225
225
|
},
|
|
226
226
|
"dead-code": {
|
|
@@ -235,13 +235,13 @@ It offers a wide variety of features, for example:
|
|
|
235
235
|
".meta": {
|
|
236
236
|
"numOfUselessLoops": 0,
|
|
237
237
|
"searchTimeMs": 0,
|
|
238
|
-
"processTimeMs":
|
|
238
|
+
"processTimeMs": 0
|
|
239
239
|
}
|
|
240
240
|
},
|
|
241
241
|
"problematic-inputs": {
|
|
242
242
|
"results": [],
|
|
243
243
|
".meta": {
|
|
244
|
-
"searchTimeMs":
|
|
244
|
+
"searchTimeMs": 1,
|
|
245
245
|
"processTimeMs": 0
|
|
246
246
|
}
|
|
247
247
|
},
|
|
@@ -249,7 +249,7 @@ It offers a wide variety of features, for example:
|
|
|
249
249
|
"results": [],
|
|
250
250
|
".meta": {
|
|
251
251
|
"consideredNodes": 0,
|
|
252
|
-
"searchTimeMs":
|
|
252
|
+
"searchTimeMs": 0,
|
|
253
253
|
"processTimeMs": 0
|
|
254
254
|
}
|
|
255
255
|
},
|
|
@@ -281,16 +281,16 @@ It offers a wide variety of features, for example:
|
|
|
281
281
|
"subscript": 0
|
|
282
282
|
},
|
|
283
283
|
"searchTimeMs": 0,
|
|
284
|
-
"processTimeMs":
|
|
284
|
+
"processTimeMs": 18
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
},
|
|
288
288
|
".meta": {
|
|
289
|
-
"timing":
|
|
289
|
+
"timing": 3550
|
|
290
290
|
}
|
|
291
291
|
},
|
|
292
292
|
".meta": {
|
|
293
|
-
"timing":
|
|
293
|
+
"timing": 3550
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
296
|
```
|
|
@@ -354,7 +354,7 @@ It offers a wide variety of features, for example:
|
|
|
354
354
|
|
|
355
355
|
```shell
|
|
356
356
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
357
|
-
flowR repl v2.13.
|
|
357
|
+
flowR repl v2.13.14, R grammar v14 (tree-sitter engine)
|
|
358
358
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
359
359
|
```
|
|
360
360
|
|
|
@@ -368,7 +368,7 @@ It offers a wide variety of features, for example:
|
|
|
368
368
|
N <- 10
|
|
369
369
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
370
370
|
sum
|
|
371
|
-
All queries together required ≈
|
|
371
|
+
All queries together required ≈10 ms (1ms accuracy, total 10 ms)
|
|
372
372
|
```
|
|
373
373
|
|
|
374
374
|
|
|
@@ -383,7 +383,7 @@ It offers a wide variety of features, for example:
|
|
|
383
383
|
</details>
|
|
384
384
|
|
|
385
385
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
386
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
386
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">76.2 ms</span></i> (as of Aug 11, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
387
387
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
388
388
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph#perspectives-cg).
|
|
389
389
|
|
|
@@ -419,7 +419,7 @@ It offers a wide variety of features, for example:
|
|
|
419
419
|
|
|
420
420
|
```shell
|
|
421
421
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
422
|
-
flowR repl v2.13.
|
|
422
|
+
flowR repl v2.13.14, R grammar v14 (tree-sitter engine)
|
|
423
423
|
R> :dataflow* test/testfiles/example.R
|
|
424
424
|
```
|
|
425
425
|
|
|
@@ -692,7 +692,7 @@ It offers a wide variety of features, for example:
|
|
|
692
692
|
```
|
|
693
693
|
|
|
694
694
|
|
|
695
|
-
(The analysis required
|
|
695
|
+
(The analysis required _1.8 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment. No [signature database](https://github.com/flowr-analysis/flowr/wiki/Signature-Database) is mounted for these generated graphs, so `library()` calls attach no package exports; base-R names are still qualified via the generated base-package store (e.g. `acf` as `stats::acf`).)
|
|
696
696
|
|
|
697
697
|
|
|
698
698
|
|
|
@@ -873,7 +873,10 @@ please check out the following publications (if you find that a paper is missing
|
|
|
873
873
|
|
|
874
874
|
## 🚀 Contributing
|
|
875
875
|
|
|
876
|
-
We welcome every contribution!
|
|
876
|
+
We welcome every contribution! The [developer onboarding](https://github.com/flowr-analysis/flowr/wiki/Onboarding) page has everything you need to get started.
|
|
877
|
+
With **R** and **Node.js** installed, `npm run setup:dev` checks your prerequisites, installs the dependencies, and configures the git hooks.
|
|
878
|
+
The [contributing guidelines](https://github.com/flowr-analysis/flowr/tree/main/.github/CONTRIBUTING.md) explain our commit conventions,
|
|
879
|
+
and [Linting and Testing](https://github.com/flowr-analysis/flowr/wiki/Linting-and-Testing) shows how to run the tests.
|
|
877
880
|
|
|
878
881
|
### Contributors
|
|
879
882
|
|
|
@@ -25,10 +25,8 @@ function resolveIdToArgName(id, info) {
|
|
|
25
25
|
* Resolves the value of a function argument as string, number, boolean, or vector using {@link resolveIdToValue}
|
|
26
26
|
*/
|
|
27
27
|
function resolveIdToArgValue(id, info) {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const resolvedValue = (0, alias_tracking_1.resolveIdToValue)(node.value, info);
|
|
31
|
-
const unliftedValue = (0, r_value_1.unliftRValue)(resolvedValue);
|
|
28
|
+
const unliftedValue = resolveArgToUnlifted(id, info);
|
|
29
|
+
if (unliftedValue !== undefined) {
|
|
32
30
|
if (Array.isArray(unliftedValue)) {
|
|
33
31
|
return (0, r_value_1.unwrapRVector)(unliftedValue);
|
|
34
32
|
}
|
|
@@ -42,10 +40,8 @@ function resolveIdToArgValue(id, info) {
|
|
|
42
40
|
* Resolves the value of a function argument to a string vector using {@link resolveIdToValue} and {@link unwrapRValueToString}
|
|
43
41
|
*/
|
|
44
42
|
function resolveIdToArgStringVector(id, info) {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
47
|
-
const resolvedValue = (0, alias_tracking_1.resolveIdToValue)(node.value, info);
|
|
48
|
-
const unliftedValue = (0, r_value_1.unliftRValue)(resolvedValue);
|
|
43
|
+
const unliftedValue = resolveArgToUnlifted(id, info);
|
|
44
|
+
if (unliftedValue !== undefined) {
|
|
49
45
|
if (Array.isArray(unliftedValue)) {
|
|
50
46
|
const array = unliftedValue.map(r_value_1.unwrapRValueToString);
|
|
51
47
|
return array.every(assert_1.isNotUndefined) ? array : undefined;
|
|
@@ -74,10 +70,8 @@ function resolveIdToArgValueSymbolName(id, info) {
|
|
|
74
70
|
* Resolves the vector length of the value of a function argument using {@link resolveIdToValue}
|
|
75
71
|
*/
|
|
76
72
|
function resolveIdToArgVectorLength(id, info) {
|
|
77
|
-
const
|
|
78
|
-
if (
|
|
79
|
-
const resolvedValue = (0, alias_tracking_1.resolveIdToValue)(node.value, info);
|
|
80
|
-
const unliftedValue = (0, r_value_1.unliftRValue)(resolvedValue);
|
|
73
|
+
const unliftedValue = resolveArgToUnlifted(id, info);
|
|
74
|
+
if (unliftedValue !== undefined) {
|
|
81
75
|
if (Array.isArray(unliftedValue)) {
|
|
82
76
|
return unliftedValue.length;
|
|
83
77
|
}
|
|
@@ -87,6 +81,11 @@ function resolveIdToArgVectorLength(id, info) {
|
|
|
87
81
|
}
|
|
88
82
|
return undefined;
|
|
89
83
|
}
|
|
84
|
+
/** The unlifted value of a function argument, `undefined` if the argument carries no value. */
|
|
85
|
+
function resolveArgToUnlifted(id, info) {
|
|
86
|
+
const node = resolveIdToArgument(id, info);
|
|
87
|
+
return node?.value !== undefined ? (0, r_value_1.unliftRValue)((0, alias_tracking_1.resolveIdToValue)(node.value, info)) : undefined;
|
|
88
|
+
}
|
|
90
89
|
function resolveIdToArgument(id, { graph, idMap }) {
|
|
91
90
|
idMap ??= graph?.idMap;
|
|
92
91
|
const node = id === undefined || typeof id === 'object' ? id : idMap?.get(id);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small, fixed, and purely synthetic workload used to calibrate the benchmark results.
|
|
3
|
+
*
|
|
4
|
+
* Publishing its runtime alongside the real measurements allows a viewer to normalize the other numbers by it,
|
|
5
|
+
* and hence to cancel out how fast or how loaded the machine was that produced them.
|
|
6
|
+
* The workload must therefore stay deterministic (no file system, no R session, no randomness)
|
|
7
|
+
* and cheap (well below a second).
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
/** How often the {@link calibrationRound} is repeated within one {@link runCalibration} call. */
|
|
11
|
+
export declare const CalibrationRounds = 8;
|
|
12
|
+
/** How many elements a single {@link calibrationRound} works on. */
|
|
13
|
+
export declare const CalibrationSize = 4096;
|
|
14
|
+
/**
|
|
15
|
+
* Runs the calibration workload {@link CalibrationRounds} times.
|
|
16
|
+
* @returns a checksum, only returned so that the work cannot be optimized away
|
|
17
|
+
*/
|
|
18
|
+
export declare function runCalibration(): number;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* A small, fixed, and purely synthetic workload used to calibrate the benchmark results.
|
|
4
|
+
*
|
|
5
|
+
* Publishing its runtime alongside the real measurements allows a viewer to normalize the other numbers by it,
|
|
6
|
+
* and hence to cancel out how fast or how loaded the machine was that produced them.
|
|
7
|
+
* The workload must therefore stay deterministic (no file system, no R session, no randomness)
|
|
8
|
+
* and cheap (well below a second).
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CalibrationSize = exports.CalibrationRounds = void 0;
|
|
13
|
+
exports.runCalibration = runCalibration;
|
|
14
|
+
/** How often the {@link calibrationRound} is repeated within one {@link runCalibration} call. */
|
|
15
|
+
exports.CalibrationRounds = 8;
|
|
16
|
+
/** How many elements a single {@link calibrationRound} works on. */
|
|
17
|
+
exports.CalibrationSize = 4096;
|
|
18
|
+
/** xorshift32 with a fixed seed so that every round does the exact same work */
|
|
19
|
+
function nextRandom(state) {
|
|
20
|
+
state ^= state << 13;
|
|
21
|
+
state ^= state >>> 17;
|
|
22
|
+
state ^= state << 5;
|
|
23
|
+
return state | 0;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* One round of the calibration workload, mixing integer arithmetic, array sorting, string handling, and map lookups
|
|
27
|
+
* to cover the operations that dominate the analysis itself.
|
|
28
|
+
* @returns a checksum, only returned so that the work cannot be optimized away
|
|
29
|
+
*/
|
|
30
|
+
function calibrationRound(round) {
|
|
31
|
+
let state = 0x1337 + round;
|
|
32
|
+
const numbers = new Array(exports.CalibrationSize);
|
|
33
|
+
for (let i = 0; i < exports.CalibrationSize; i++) {
|
|
34
|
+
state = nextRandom(state);
|
|
35
|
+
numbers[i] = state % 100_000;
|
|
36
|
+
}
|
|
37
|
+
numbers.sort((a, b) => a - b);
|
|
38
|
+
const map = new Map();
|
|
39
|
+
for (let i = 0; i < exports.CalibrationSize; i++) {
|
|
40
|
+
const key = `k${numbers[i] % 512}`;
|
|
41
|
+
map.set(key, (map.get(key) ?? 0) + i);
|
|
42
|
+
}
|
|
43
|
+
let checksum = 0;
|
|
44
|
+
for (const [key, value] of map) {
|
|
45
|
+
checksum = (checksum + key.length * value) | 0;
|
|
46
|
+
}
|
|
47
|
+
for (let i = 0; i < exports.CalibrationSize; i++) {
|
|
48
|
+
checksum = (checksum + Math.floor(Math.sqrt(numbers[i] + 1))) | 0;
|
|
49
|
+
}
|
|
50
|
+
return checksum;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Runs the calibration workload {@link CalibrationRounds} times.
|
|
54
|
+
* @returns a checksum, only returned so that the work cannot be optimized away
|
|
55
|
+
*/
|
|
56
|
+
function runCalibration() {
|
|
57
|
+
let checksum = 0;
|
|
58
|
+
for (let round = 0; round < exports.CalibrationRounds; round++) {
|
|
59
|
+
checksum = (checksum + calibrationRound(round)) | 0;
|
|
60
|
+
}
|
|
61
|
+
return checksum;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=calibration.js.map
|
package/benchmark/slicer.d.ts
CHANGED
|
@@ -56,8 +56,12 @@ export declare class BenchmarkSlicer {
|
|
|
56
56
|
private readonly commonMeasurements;
|
|
57
57
|
private readonly perSliceMeasurements;
|
|
58
58
|
private readonly deltas;
|
|
59
|
+
/** filled by {@link measureAdditionalPhases}, only holds the phases that did not fail */
|
|
60
|
+
private readonly additionalMeasurements;
|
|
59
61
|
private readonly parserName;
|
|
60
62
|
private context;
|
|
63
|
+
private config;
|
|
64
|
+
private request;
|
|
61
65
|
private stats;
|
|
62
66
|
private loadedXml;
|
|
63
67
|
private dataflow;
|
|
@@ -91,6 +95,21 @@ export declare class BenchmarkSlicer {
|
|
|
91
95
|
* @returns The statistics of the data frame shape inference
|
|
92
96
|
*/
|
|
93
97
|
inferDataFrameShapes(): SlicerStatsDfShape;
|
|
98
|
+
/**
|
|
99
|
+
* Measure the phases that are not part of the slicing itself: the dependencies query, the linter,
|
|
100
|
+
* and the synthetic {@link runCalibration | calibration} workload.
|
|
101
|
+
*
|
|
102
|
+
* These run *after* all other steps and are excluded from the {@link CommonSlicerMeasurements} (and hence from
|
|
103
|
+
* the `total`), so that they cannot distort any of the existing measurements.
|
|
104
|
+
* A failing phase is logged and skipped, it never aborts the benchmark.
|
|
105
|
+
*/
|
|
106
|
+
measureAdditionalPhases(): Promise<void>;
|
|
107
|
+
/**
|
|
108
|
+
* The additional phases work on the analyzer api, so we have to set up an analyzer for the same request.
|
|
109
|
+
* All of its analyses happen before the measurement starts.
|
|
110
|
+
*/
|
|
111
|
+
private buildAnalyzerForAdditionalPhases;
|
|
112
|
+
private measureAdditional;
|
|
94
113
|
private getInferredRange;
|
|
95
114
|
private getInferredNumber;
|
|
96
115
|
/** Bridging the gap between the new internal and the old names for the benchmarking */
|
package/benchmark/slicer.js
CHANGED
|
@@ -32,6 +32,8 @@ const flowr_analyzer_context_1 = require("../project/context/flowr-analyzer-cont
|
|
|
32
32
|
const r_project_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-project");
|
|
33
33
|
const r_comment_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-comment");
|
|
34
34
|
const call_graph_1 = require("../dataflow/graph/call-graph");
|
|
35
|
+
const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
|
|
36
|
+
const calibration_1 = require("./calibration");
|
|
35
37
|
/**
|
|
36
38
|
* The logger to be used for benchmarking as a global object.
|
|
37
39
|
*/
|
|
@@ -41,8 +43,12 @@ class BenchmarkSlicer {
|
|
|
41
43
|
commonMeasurements = new stopwatch_1.Measurements();
|
|
42
44
|
perSliceMeasurements = new Map();
|
|
43
45
|
deltas = new Map();
|
|
46
|
+
/** filled by {@link measureAdditionalPhases}, only holds the phases that did not fail */
|
|
47
|
+
additionalMeasurements = new Map();
|
|
44
48
|
parserName;
|
|
45
49
|
context;
|
|
50
|
+
config;
|
|
51
|
+
request;
|
|
46
52
|
stats;
|
|
47
53
|
loadedXml;
|
|
48
54
|
dataflow;
|
|
@@ -74,6 +80,8 @@ class BenchmarkSlicer {
|
|
|
74
80
|
return new tree_sitter_executor_1.TreeSitterExecutor();
|
|
75
81
|
}
|
|
76
82
|
});
|
|
83
|
+
this.config = config;
|
|
84
|
+
this.request = request;
|
|
77
85
|
this.context = (0, flowr_analyzer_context_1.contextFromInput)({ ...request }, config);
|
|
78
86
|
this.executor = (0, default_pipelines_1.createSlicePipeline)(this.parser, {
|
|
79
87
|
context: this.context,
|
|
@@ -149,6 +157,7 @@ class BenchmarkSlicer {
|
|
|
149
157
|
const nonWhitespace = (0, strings_1.withoutWhitespace)(loadedContent).length;
|
|
150
158
|
this.stats = {
|
|
151
159
|
perSliceMeasurements: this.perSliceMeasurements,
|
|
160
|
+
additionalMeasurements: this.additionalMeasurements,
|
|
152
161
|
memory: this.deltas,
|
|
153
162
|
request,
|
|
154
163
|
input: {
|
|
@@ -175,7 +184,11 @@ class BenchmarkSlicer {
|
|
|
175
184
|
retrieveTimePerToken: { raw: 0, normalized: 0 },
|
|
176
185
|
normalizeTimePerToken: { raw: 0, normalized: 0 },
|
|
177
186
|
dataflowTimePerToken: { raw: 0, normalized: 0 },
|
|
178
|
-
totalCommonTimePerToken: { raw: 0, normalized: 0 }
|
|
187
|
+
totalCommonTimePerToken: { raw: 0, normalized: 0 },
|
|
188
|
+
retrieveTimePer100Lines: 0,
|
|
189
|
+
normalizeTimePer100Lines: 0,
|
|
190
|
+
dataflowTimePer100Lines: 0,
|
|
191
|
+
totalCommonTimePer100Lines: 0
|
|
179
192
|
};
|
|
180
193
|
}
|
|
181
194
|
/**
|
|
@@ -233,6 +246,13 @@ class BenchmarkSlicer {
|
|
|
233
246
|
(0, assert_1.guard)(this.normalizedAst !== undefined, 'normalizedAst should be defined for control flow extraction');
|
|
234
247
|
const ast = this.normalizedAst;
|
|
235
248
|
this.controlFlow = this.measureSimpleStep('extract control flow graph', () => (0, extract_cfg_1.extractCfg)(ast, this.context, undefined, undefined, true));
|
|
249
|
+
if (this.stats) {
|
|
250
|
+
this.stats.controlFlow = {
|
|
251
|
+
numberOfVertices: this.controlFlow.graph.vertices(true).size,
|
|
252
|
+
numberOfEdges: [...this.controlFlow.graph.edges().values()].reduce((a, e) => a + e.size, 0),
|
|
253
|
+
sizeOfObject: (0, size_of_1.getSizeOfCfGraph)(this.controlFlow.graph)
|
|
254
|
+
};
|
|
255
|
+
}
|
|
236
256
|
}
|
|
237
257
|
extractCG() {
|
|
238
258
|
exports.benchmarkLogger.trace('try to extract the call graph');
|
|
@@ -322,6 +342,63 @@ class BenchmarkSlicer {
|
|
|
322
342
|
this.stats.dataFrameShape = stats;
|
|
323
343
|
return stats;
|
|
324
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Measure the phases that are not part of the slicing itself: the dependencies query, the linter,
|
|
347
|
+
* and the synthetic {@link runCalibration | calibration} workload.
|
|
348
|
+
*
|
|
349
|
+
* These run *after* all other steps and are excluded from the {@link CommonSlicerMeasurements} (and hence from
|
|
350
|
+
* the `total`), so that they cannot distort any of the existing measurements.
|
|
351
|
+
* A failing phase is logged and skipped, it never aborts the benchmark.
|
|
352
|
+
*/
|
|
353
|
+
async measureAdditionalPhases() {
|
|
354
|
+
this.totalStopwatch.pause();
|
|
355
|
+
try {
|
|
356
|
+
this.guardActive();
|
|
357
|
+
const analyzer = await this.buildAnalyzerForAdditionalPhases();
|
|
358
|
+
if (analyzer !== undefined) {
|
|
359
|
+
await this.measureAdditional('dependencies query', () => analyzer.query([{ type: 'dependencies' }]));
|
|
360
|
+
await this.measureAdditional('linter run', () => analyzer.query([{ type: 'linter' }]));
|
|
361
|
+
}
|
|
362
|
+
await this.measureAdditional('calibration', () => (0, calibration_1.runCalibration)());
|
|
363
|
+
}
|
|
364
|
+
catch (e) {
|
|
365
|
+
exports.benchmarkLogger.error(`failed to measure the additional phases: ${e instanceof Error ? e.message : String(e)}`);
|
|
366
|
+
}
|
|
367
|
+
finally {
|
|
368
|
+
this.totalStopwatch.resume();
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* The additional phases work on the analyzer api, so we have to set up an analyzer for the same request.
|
|
373
|
+
* All of its analyses happen before the measurement starts.
|
|
374
|
+
*/
|
|
375
|
+
async buildAnalyzerForAdditionalPhases() {
|
|
376
|
+
try {
|
|
377
|
+
(0, assert_1.guard)(this.config !== undefined && this.request !== undefined, 'need to call init before the additional phases');
|
|
378
|
+
const analyzer = new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
|
|
379
|
+
.setParser(this.parser)
|
|
380
|
+
.setConfig(this.config)
|
|
381
|
+
.buildSync();
|
|
382
|
+
analyzer.addRequest({ ...this.request });
|
|
383
|
+
await analyzer.runFull();
|
|
384
|
+
return analyzer;
|
|
385
|
+
}
|
|
386
|
+
catch (e) {
|
|
387
|
+
exports.benchmarkLogger.error(`failed to set up the analyzer for the additional phases: ${e instanceof Error ? e.message : String(e)}`);
|
|
388
|
+
return undefined;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
async measureAdditional(keyToMeasure, measurement) {
|
|
392
|
+
const start = process.hrtime.bigint();
|
|
393
|
+
try {
|
|
394
|
+
await measurement();
|
|
395
|
+
}
|
|
396
|
+
catch (e) {
|
|
397
|
+
exports.benchmarkLogger.error(`failed to measure '${keyToMeasure}': ${e instanceof Error ? e.message : String(e)}`);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
this.additionalMeasurements.set(keyToMeasure, process.hrtime.bigint() - start);
|
|
401
|
+
}
|
|
325
402
|
getInferredRange(value) {
|
|
326
403
|
if (value.isValue()) {
|
|
327
404
|
if (value instanceof set_range_domain_1.SetRangeDomain) {
|
|
@@ -463,6 +540,12 @@ class BenchmarkSlicer {
|
|
|
463
540
|
raw: dataFrameShapeTime / this.stats.input.numberOfRTokens,
|
|
464
541
|
normalized: dataFrameShapeTime / this.stats.input.numberOfNormalizedTokens,
|
|
465
542
|
};
|
|
543
|
+
const per100Lines = 100 / this.stats.input.numberOfLines;
|
|
544
|
+
this.stats.retrieveTimePer100Lines = retrieveTime * per100Lines;
|
|
545
|
+
this.stats.normalizeTimePer100Lines = normalizeTime * per100Lines;
|
|
546
|
+
this.stats.dataflowTimePer100Lines = dataflowTime * per100Lines;
|
|
547
|
+
this.stats.totalCommonTimePer100Lines = (retrieveTime + normalizeTime + dataflowTime) * per100Lines;
|
|
548
|
+
this.stats.controlFlowTimePer100Lines = Number.isNaN(controlFlowTime) ? undefined : controlFlowTime * per100Lines;
|
|
466
549
|
return {
|
|
467
550
|
stats: this.stats,
|
|
468
551
|
parse: typeof this.loadedXml === 'string' ? this.loadedXml : JSON.stringify(this.loadedXml),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FlowrFeatureCounts } from './stats';
|
|
2
|
+
/**
|
|
3
|
+
* Counts the linting rules, their tags, the queries, and the built-in definitions by the handler they use.
|
|
4
|
+
* Every count is defensive, as this also runs against older definitions when the history is filled in.
|
|
5
|
+
*/
|
|
6
|
+
export declare function countFeatures(): FlowrFeatureCounts;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.countFeatures = countFeatures;
|
|
4
|
+
/**
|
|
5
|
+
* Counts what the running flowR version carries, so a release also shows how the feature set grew.
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
/* the query module has to come first, the linter rules import back into it */
|
|
9
|
+
const query_1 = require("../../queries/query");
|
|
10
|
+
const linter_rules_1 = require("../../linter/linter-rules");
|
|
11
|
+
const default_builtin_config_1 = require("../../dataflow/environments/default-builtin-config");
|
|
12
|
+
const built_in_proc_name_1 = require("../../dataflow/environments/built-in-proc-name");
|
|
13
|
+
const DefaultProcessors = [built_in_proc_name_1.BuiltInProcName.Default, built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs];
|
|
14
|
+
/** how many linting rules carry each tag, a rule usually carries several */
|
|
15
|
+
function countRuleTags() {
|
|
16
|
+
const tags = {};
|
|
17
|
+
for (const rule of Object.values(linter_rules_1.LintingRules ?? {})) {
|
|
18
|
+
const own = rule?.info?.tags;
|
|
19
|
+
if (!Array.isArray(own)) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
for (const tag of own) {
|
|
23
|
+
if (typeof tag === 'string') {
|
|
24
|
+
tags[tag] = (tags[tag] ?? 0) + 1;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return tags;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Counts the linting rules, their tags, the queries, and the built-in definitions by the handler they use.
|
|
32
|
+
* Every count is defensive, as this also runs against older definitions when the history is filled in.
|
|
33
|
+
*/
|
|
34
|
+
function countFeatures() {
|
|
35
|
+
const builtins = (Array.isArray(default_builtin_config_1.DefaultBuiltinConfig) ? default_builtin_config_1.DefaultBuiltinConfig : []);
|
|
36
|
+
let def = 0, custom = 0, evals = 0;
|
|
37
|
+
for (const entry of builtins) {
|
|
38
|
+
const processor = entry?.processor;
|
|
39
|
+
if (typeof processor === 'string') {
|
|
40
|
+
if (DefaultProcessors.includes(processor)) {
|
|
41
|
+
def++;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
custom++;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (entry?.evalHandler !== undefined) {
|
|
48
|
+
evals++;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
lintingRules: Object.keys(linter_rules_1.LintingRules ?? {}).length,
|
|
53
|
+
queries: Object.keys(query_1.SupportedQueries ?? {}).length,
|
|
54
|
+
builtinDefinitions: builtins.length,
|
|
55
|
+
builtinDefinitionsDefault: def,
|
|
56
|
+
builtinDefinitionsCustom: custom,
|
|
57
|
+
builtinDefinitionsWithEvalHandler: evals,
|
|
58
|
+
lintingRulesByTag: countRuleTags()
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=feature-counts.js.map
|
package/benchmark/stats/print.js
CHANGED
|
@@ -229,6 +229,26 @@ Dataframe shape inference: ${formatSummarizedTimeMeasure(stats.common
|
|
|
229
229
|
Dataframe shape inference per token: ${formatSummarizedTimeMeasure(stats.dataFrameShapeTimePerToken.normalized)}
|
|
230
230
|
Dataframe shape inference per R token:${formatSummarizedTimeMeasure(stats.dataFrameShapeTimePerToken.raw)}`;
|
|
231
231
|
}
|
|
232
|
+
result += `
|
|
233
|
+
|
|
234
|
+
Per 100 lines of input:
|
|
235
|
+
AST retrieval: ${formatSummarizedTimeMeasure(stats.retrieveTimePer100Lines)}
|
|
236
|
+
AST normalization: ${formatSummarizedTimeMeasure(stats.normalizeTimePer100Lines)}
|
|
237
|
+
Dataflow creation: ${formatSummarizedTimeMeasure(stats.dataflowTimePer100Lines)}
|
|
238
|
+
Control flow extraction: ${formatSummarizedTimeMeasure(stats.controlFlowTimePer100Lines)}
|
|
239
|
+
Total common: ${formatSummarizedTimeMeasure(stats.totalCommonTimePer100Lines)}
|
|
240
|
+
Slice creation: ${formatSummarizedTimeMeasure(stats.sliceTimePer100Lines)}
|
|
241
|
+
Reconstruction: ${formatSummarizedTimeMeasure(stats.reconstructTimePer100Lines)}
|
|
242
|
+
Total per slice: ${formatSummarizedTimeMeasure(stats.totalPerSliceTimePer100Lines)}`;
|
|
243
|
+
if (stats.additionalMeasurements !== undefined && stats.additionalMeasurements.size > 0) {
|
|
244
|
+
result += `
|
|
245
|
+
|
|
246
|
+
Additional phases (not part of the total):`;
|
|
247
|
+
for (const [name, measure] of stats.additionalMeasurements) {
|
|
248
|
+
result += `
|
|
249
|
+
${name.padEnd(34, ' ')}${formatSummarizedTimeMeasure(measure)}`;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
232
252
|
// Used Slice Criteria Sizes: ${formatSummarizedMeasure(stats.perSliceMeasurements.sliceCriteriaSizes)}
|
|
233
253
|
if (stats.totalSlices > 0) {
|
|
234
254
|
result += `
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SigDbCounts } from './stats';
|
|
2
|
+
/**
|
|
3
|
+
* Counts the bundles of the mounted signature database, what they describe, and what they occupy.
|
|
4
|
+
* Every step is defensive, as this also runs against older databases when the history is filled in, and a
|
|
5
|
+
* machine without a mounted database simply yields `undefined` instead of failing the benchmark.
|
|
6
|
+
*/
|
|
7
|
+
export declare function countSignatureDatabase(): Promise<SigDbCounts | undefined>;
|