@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
|
@@ -3,30 +3,172 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isInfoEntry = isInfoEntry;
|
|
7
|
+
exports.infoGraphPath = infoGraphPath;
|
|
6
8
|
exports.writeGraphOutput = writeGraphOutput;
|
|
7
9
|
const fs_1 = __importDefault(require("fs"));
|
|
8
10
|
const json_1 = require("../../../util/json");
|
|
11
|
+
const feature_counts_1 = require("../../stats/feature-counts");
|
|
12
|
+
const sigdb_counts_1 = require("../../stats/sigdb-counts");
|
|
13
|
+
/** ns to ms */
|
|
14
|
+
function ms(nanoseconds) {
|
|
15
|
+
return nanoseconds / 1e6;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Every plotted number is the mean, so that one series never mixes two statistics: a run that switches
|
|
19
|
+
* to the median steps up or down by the skew of the corpus, which reads as a change that never happened.
|
|
20
|
+
* The median travels along as additional information, see {@link plotExtra}.
|
|
21
|
+
*/
|
|
22
|
+
function plotValue(measurement) {
|
|
23
|
+
return Number.isFinite(measurement.mean) ? measurement.mean : measurement.median;
|
|
24
|
+
}
|
|
25
|
+
/** the statistics a plotted mean is worth nothing without, stated on hover */
|
|
26
|
+
function plotExtra(measurement, digits = 2, scale = 1, unit = '') {
|
|
27
|
+
const say = (v) => (v * scale).toFixed(digits) + unit;
|
|
28
|
+
return `median: ${say(measurement.median)}, std: ${say(measurement.std)}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Whether an entry describes what the release *is* rather than how fast it *was*.
|
|
32
|
+
*
|
|
33
|
+
* The benchmark action compares every entry it uploads against the release before and calls a value that grew
|
|
34
|
+
* a regression. That is right for a runtime and wrong for a counter: a release with ten more linting rules or a
|
|
35
|
+
* larger signature database is not slower. Those entries are written to {@link infoGraphPath} instead and are
|
|
36
|
+
* uploaded under a suite of their own, where nothing alerts on them. The page merges the two back together.
|
|
37
|
+
*
|
|
38
|
+
* The failures are counters too, but a run that fails to re-parse more slices than the one before is exactly
|
|
39
|
+
* what an alert is for, so they stay with the measurements.
|
|
40
|
+
*/
|
|
41
|
+
function isInfoEntry({ name, unit }) {
|
|
42
|
+
if (name.startsWith(SigDbPrefix)) {
|
|
43
|
+
return true; // the database ships with the release, its size is not this run being slow
|
|
44
|
+
}
|
|
45
|
+
if (unit === 'ms' || name.startsWith('memory')) {
|
|
46
|
+
return false; // a runtime or a size the analysis has to hold, both worth an alert
|
|
47
|
+
}
|
|
48
|
+
return unit === '#' && !/^(reduction|failed|times hit)/.test(name);
|
|
49
|
+
}
|
|
50
|
+
/** where the counters of `path` go, next to it, so that one upload can alert and the other cannot */
|
|
51
|
+
function infoGraphPath(path) {
|
|
52
|
+
return path.replace(/(\.json)?$/, m => '-info' + (m || '.json'));
|
|
53
|
+
}
|
|
54
|
+
function timeEntry(name, measurement) {
|
|
55
|
+
if (!measurement?.mean || !measurement?.std) {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
name,
|
|
60
|
+
unit: 'ms',
|
|
61
|
+
value: ms(plotValue(measurement)),
|
|
62
|
+
range: String(ms(measurement.std)),
|
|
63
|
+
extra: plotExtra(measurement, 2, 1 / 1e6, 'ms')
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const SigDbPrefix = 'signature database';
|
|
67
|
+
/** bytes to KiB */
|
|
68
|
+
function kib(bytes) {
|
|
69
|
+
return bytes / 1024;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* What the signature database of the benchmarked release carries. It describes the machine, not a single
|
|
73
|
+
* measurement, so it is counted here, once, after every measured phase, and a machine without a mounted
|
|
74
|
+
* database simply contributes nothing.
|
|
75
|
+
*/
|
|
76
|
+
function signatureDatabaseEntries(counts) {
|
|
77
|
+
if (counts === undefined) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
const data = [];
|
|
81
|
+
const count = (name, value) => {
|
|
82
|
+
if (typeof value === 'number') {
|
|
83
|
+
data.push({ name: `${SigDbPrefix} ${name}`, unit: '#', value });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const bytes = (name, value) => {
|
|
87
|
+
if (typeof value === 'number') {
|
|
88
|
+
data.push({ name: `${SigDbPrefix} ${name}`, unit: 'KiB', value: kib(value) });
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
count('bundles', counts.bundles);
|
|
92
|
+
for (const [kind, value] of Object.entries(counts.bundlesByKind ?? {})) {
|
|
93
|
+
count(`bundles (${kind})`, value);
|
|
94
|
+
}
|
|
95
|
+
count('packages', counts.packages);
|
|
96
|
+
count('package versions', counts.packageVersions);
|
|
97
|
+
count('functions', counts.functions);
|
|
98
|
+
for (const [kind, value] of Object.entries(counts.functionsByKind ?? {})) {
|
|
99
|
+
count(`functions (${kind})`, value);
|
|
100
|
+
}
|
|
101
|
+
count('base functions', counts.base?.functions);
|
|
102
|
+
count('base parameters', counts.base?.parameters);
|
|
103
|
+
for (const [carries, value] of Object.entries(counts.base?.functionsCarrying ?? {})) {
|
|
104
|
+
count(`base functions (${carries})`, value);
|
|
105
|
+
}
|
|
106
|
+
bytes('size', counts.size);
|
|
107
|
+
for (const [kind, value] of Object.entries(counts.sizeByKind ?? {})) {
|
|
108
|
+
bytes(`size (${kind})`, value);
|
|
109
|
+
}
|
|
110
|
+
bytes('size (dictionaries)', counts.sizeOfDictionaries);
|
|
111
|
+
bytes('size (manifests)', counts.sizeOfManifests);
|
|
112
|
+
return data;
|
|
113
|
+
}
|
|
9
114
|
/**
|
|
10
115
|
* Write the graph output for the ultimate slicer stats to a file
|
|
11
116
|
* @param ultimate - The ultimate slicer stats
|
|
12
117
|
* @param outputGraphPath - The path to write the graph output to
|
|
13
118
|
*/
|
|
14
|
-
function writeGraphOutput(ultimate, outputGraphPath) {
|
|
119
|
+
async function writeGraphOutput(ultimate, outputGraphPath) {
|
|
15
120
|
console.log(`Producing benchmark graph data (${outputGraphPath})...`);
|
|
16
121
|
const data = [];
|
|
17
|
-
for (const { name, measurements } of [
|
|
122
|
+
for (const { name, measurements } of [
|
|
123
|
+
{ name: 'per-file', measurements: ultimate.commonMeasurements },
|
|
124
|
+
{ name: 'per-slice', measurements: ultimate.perSliceMeasurements },
|
|
125
|
+
{ name: 'additional', measurements: ultimate.additionalMeasurements ?? new Map() }
|
|
126
|
+
]) {
|
|
18
127
|
for (const [point, measurement] of measurements) {
|
|
19
|
-
if (point === 'close R session' || point === 'initialize R session'
|
|
128
|
+
if (point === 'close R session' || point === 'initialize R session') {
|
|
20
129
|
continue;
|
|
21
130
|
}
|
|
22
131
|
const pointName = point === 'total' ? `total ${name}` : point;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
132
|
+
const entry = timeEntry(pointName[0].toUpperCase() + pointName.slice(1), measurement);
|
|
133
|
+
if (entry) {
|
|
134
|
+
data.push(entry);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// the per 100 lines of input pendants to the per-token measurements, less sensitive to the file size mix
|
|
139
|
+
for (const { name, measurement } of [
|
|
140
|
+
{ name: 'Retrieve AST per 100 lines', measurement: ultimate.retrieveTimePer100Lines },
|
|
141
|
+
{ name: 'Normalize AST per 100 lines', measurement: ultimate.normalizeTimePer100Lines },
|
|
142
|
+
{ name: 'Dataflow per 100 lines', measurement: ultimate.dataflowTimePer100Lines },
|
|
143
|
+
{ name: 'Control flow per 100 lines', measurement: ultimate.controlFlowTimePer100Lines },
|
|
144
|
+
{ name: 'Static slicing per 100 lines', measurement: ultimate.sliceTimePer100Lines },
|
|
145
|
+
{ name: 'Reconstruct code per 100 lines', measurement: ultimate.reconstructTimePer100Lines },
|
|
146
|
+
{ name: 'Total common per 100 lines', measurement: ultimate.totalCommonTimePer100Lines },
|
|
147
|
+
{ name: 'Total per-slice per 100 lines', measurement: ultimate.totalPerSliceTimePer100Lines }
|
|
148
|
+
]) {
|
|
149
|
+
const entry = timeEntry(name, measurement);
|
|
150
|
+
if (entry) {
|
|
151
|
+
data.push(entry);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
// what the analyzed version of flowR itself carries, so a release also shows how the feature set grew.
|
|
155
|
+
// It describes the version, not the suite, so it is counted here, once, instead of in every benchmarked file.
|
|
156
|
+
const features = (0, feature_counts_1.countFeatures)();
|
|
157
|
+
for (const [name, value] of [
|
|
158
|
+
['linting rules', features.lintingRules],
|
|
159
|
+
['queries', features.queries],
|
|
160
|
+
['built-in definitions', features.builtinDefinitions],
|
|
161
|
+
['built-in definitions (default handler)', features.builtinDefinitionsDefault],
|
|
162
|
+
['built-in definitions (own handler)', features.builtinDefinitionsCustom],
|
|
163
|
+
['built-in definitions (with eval handler)', features.builtinDefinitionsWithEvalHandler]
|
|
164
|
+
]) {
|
|
165
|
+
if (typeof value === 'number') {
|
|
166
|
+
data.push({ name, unit: '#', value });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
for (const [tag, value] of Object.entries(features.lintingRulesByTag)) {
|
|
170
|
+
if (typeof value === 'number') {
|
|
171
|
+
data.push({ name: `linting rules (${tag})`, unit: '#', value });
|
|
30
172
|
}
|
|
31
173
|
}
|
|
32
174
|
data.push({
|
|
@@ -34,6 +176,67 @@ function writeGraphOutput(ultimate, outputGraphPath) {
|
|
|
34
176
|
unit: '#',
|
|
35
177
|
value: ultimate.totalRequests
|
|
36
178
|
});
|
|
179
|
+
data.push({
|
|
180
|
+
name: 'number of slices',
|
|
181
|
+
unit: '#',
|
|
182
|
+
value: ultimate.totalSlices
|
|
183
|
+
});
|
|
184
|
+
// what the analysis works on and produces, so a change in runtime can be related to a change in size
|
|
185
|
+
for (const [name, measurement] of [
|
|
186
|
+
['input lines', ultimate.input.numberOfLines],
|
|
187
|
+
['input tokens (normalized)', ultimate.input.numberOfNormalizedTokens],
|
|
188
|
+
['dataflow vertices', ultimate.dataflow.numberOfNodes],
|
|
189
|
+
['dataflow edges', ultimate.dataflow.numberOfEdges],
|
|
190
|
+
['dataflow calls', ultimate.dataflow.numberOfCalls],
|
|
191
|
+
['dataflow function definitions', ultimate.dataflow.numberOfFunctionDefinitions],
|
|
192
|
+
['control flow vertices', ultimate.controlFlow?.numberOfVertices],
|
|
193
|
+
['control flow edges', ultimate.controlFlow?.numberOfEdges]
|
|
194
|
+
]) {
|
|
195
|
+
if (measurement) {
|
|
196
|
+
data.push({
|
|
197
|
+
name,
|
|
198
|
+
unit: '#',
|
|
199
|
+
value: plotValue(measurement),
|
|
200
|
+
range: String(measurement.std),
|
|
201
|
+
extra: plotExtra(measurement)
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// what the data frame shape inference sees and how precise it is, so a change in its precision becomes visible
|
|
206
|
+
const shapes = ultimate.dataFrameShape;
|
|
207
|
+
if (shapes) {
|
|
208
|
+
const files = shapes.numberOfDataFrameFiles + shapes.numberOfNonDataFrameFiles;
|
|
209
|
+
data.push({
|
|
210
|
+
name: 'files with data frames',
|
|
211
|
+
unit: '#',
|
|
212
|
+
value: shapes.numberOfDataFrameFiles,
|
|
213
|
+
extra: `out of ${files} files`
|
|
214
|
+
});
|
|
215
|
+
// only a few files of a suite use data frames at all, so the median over all files would be zero
|
|
216
|
+
for (const [name, measurement] of [
|
|
217
|
+
['data frame operations', shapes.numberOfOperations],
|
|
218
|
+
['data frame operation nodes', shapes.numberOfOperationNodes],
|
|
219
|
+
['data frame value nodes', shapes.numberOfValueNodes],
|
|
220
|
+
['data frame constraints', shapes.numberOfTotalConstraints],
|
|
221
|
+
['data frame shapes (exact)', shapes.numberOfTotalExact],
|
|
222
|
+
['data frame shapes (bottom)', shapes.numberOfTotalBottom],
|
|
223
|
+
['data frame shapes (top)', shapes.numberOfTotalTop]
|
|
224
|
+
]) {
|
|
225
|
+
data.push({
|
|
226
|
+
name,
|
|
227
|
+
unit: '#',
|
|
228
|
+
value: measurement.total,
|
|
229
|
+
extra: `mean: ${measurement.mean.toFixed(2)} per file, median: ${measurement.median.toFixed(2)}`
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
data.push({
|
|
233
|
+
name: 'memory (df-shapes)',
|
|
234
|
+
unit: 'KiB',
|
|
235
|
+
value: plotValue(shapes.sizeOfInfo) / 1024,
|
|
236
|
+
range: String(shapes.sizeOfInfo.std / 1024),
|
|
237
|
+
extra: plotExtra(shapes.sizeOfInfo, 2, 1 / 1024, ' KiB')
|
|
238
|
+
});
|
|
239
|
+
}
|
|
37
240
|
data.push({
|
|
38
241
|
name: 'failed to reconstruct/re-parse',
|
|
39
242
|
unit: '#',
|
|
@@ -45,26 +248,54 @@ function writeGraphOutput(ultimate, outputGraphPath) {
|
|
|
45
248
|
unit: '#',
|
|
46
249
|
value: ultimate.timesHitThreshold
|
|
47
250
|
});
|
|
251
|
+
// the reduction without comments and empty lines tells a different story than the raw one
|
|
252
|
+
for (const [name, measurement] of [
|
|
253
|
+
['reduction (lines)', ultimate.reduction.numberOfLines],
|
|
254
|
+
['reduction (dataflow vertices)', ultimate.reduction.numberOfDataflowNodes],
|
|
255
|
+
['reduction no fluff (characters)', ultimate.reductionNoFluff.numberOfCharacters],
|
|
256
|
+
['reduction no fluff (normalized tokens)', ultimate.reductionNoFluff.numberOfNormalizedTokens]
|
|
257
|
+
]) {
|
|
258
|
+
if (measurement) {
|
|
259
|
+
data.push({
|
|
260
|
+
name,
|
|
261
|
+
unit: '#',
|
|
262
|
+
value: plotValue(measurement),
|
|
263
|
+
extra: plotExtra(measurement, 4)
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
48
267
|
data.push({
|
|
49
268
|
name: 'reduction (characters)',
|
|
50
269
|
unit: '#',
|
|
51
|
-
value: ultimate.reduction.numberOfCharacters
|
|
52
|
-
extra:
|
|
270
|
+
value: plotValue(ultimate.reduction.numberOfCharacters),
|
|
271
|
+
extra: plotExtra(ultimate.reduction.numberOfCharacters, 4)
|
|
53
272
|
});
|
|
54
273
|
data.push({
|
|
55
274
|
name: 'reduction (normalized tokens)',
|
|
56
275
|
unit: '#',
|
|
57
|
-
value: ultimate.reduction.numberOfNormalizedTokens
|
|
58
|
-
extra:
|
|
276
|
+
value: plotValue(ultimate.reduction.numberOfNormalizedTokens),
|
|
277
|
+
extra: plotExtra(ultimate.reduction.numberOfNormalizedTokens, 4)
|
|
59
278
|
});
|
|
279
|
+
if (ultimate.controlFlow) {
|
|
280
|
+
data.push({
|
|
281
|
+
name: 'memory (cfg-graph)',
|
|
282
|
+
unit: 'KiB',
|
|
283
|
+
value: plotValue(ultimate.controlFlow.sizeOfObject) / 1024,
|
|
284
|
+
range: String(ultimate.controlFlow.sizeOfObject.std / 1024),
|
|
285
|
+
extra: plotExtra(ultimate.controlFlow.sizeOfObject, 2, 1 / 1024, ' KiB')
|
|
286
|
+
});
|
|
287
|
+
}
|
|
60
288
|
data.push({
|
|
61
289
|
name: 'memory (df-graph)',
|
|
62
290
|
unit: 'KiB',
|
|
63
|
-
value: ultimate.dataflow.sizeOfObject
|
|
291
|
+
value: plotValue(ultimate.dataflow.sizeOfObject) / 1024,
|
|
64
292
|
range: String(ultimate.dataflow.sizeOfObject.std / 1024),
|
|
65
|
-
extra:
|
|
293
|
+
extra: plotExtra(ultimate.dataflow.sizeOfObject, 2, 1 / 1024, ' KiB')
|
|
66
294
|
});
|
|
67
|
-
//
|
|
68
|
-
|
|
295
|
+
// the database is a property of the release, not of a file, so it is counted once and comes last
|
|
296
|
+
data.push(...signatureDatabaseEntries(await (0, sigdb_counts_1.countSignatureDatabase)()));
|
|
297
|
+
/* the counters go into a file of their own, see infoGraphPath */
|
|
298
|
+
fs_1.default.writeFileSync(outputGraphPath, JSON.stringify(data.filter(e => !isInfoEntry(e)), json_1.jsonReplacer));
|
|
299
|
+
fs_1.default.writeFileSync(infoGraphPath(outputGraphPath), JSON.stringify(data.filter(isInfoEntry), json_1.jsonReplacer));
|
|
69
300
|
}
|
|
70
301
|
//# sourceMappingURL=graph.js.map
|
|
@@ -17,6 +17,15 @@ const arrays_1 = require("../../../util/collections/arrays");
|
|
|
17
17
|
function summarizeAllSummarizedStats(stats) {
|
|
18
18
|
const commonMeasurements = new defaultmap_1.DefaultMap(() => []);
|
|
19
19
|
const perSliceMeasurements = new defaultmap_1.DefaultMap(() => []);
|
|
20
|
+
const additionalMeasurements = new defaultmap_1.DefaultMap(() => []);
|
|
21
|
+
const retrieveTimesPer100Lines = [];
|
|
22
|
+
const normalizeTimesPer100Lines = [];
|
|
23
|
+
const dataflowTimesPer100Lines = [];
|
|
24
|
+
const totalCommonTimesPer100Lines = [];
|
|
25
|
+
const controlFlowTimesPer100Lines = [];
|
|
26
|
+
const sliceTimesPer100Lines = [];
|
|
27
|
+
const reconstructTimesPer100Lines = [];
|
|
28
|
+
const totalPerSliceTimesPer100Lines = [];
|
|
20
29
|
const sliceTimesPerToken = [];
|
|
21
30
|
const reconstructTimesPerToken = [];
|
|
22
31
|
const totalPerSliceTimesPerToken = [];
|
|
@@ -43,6 +52,19 @@ function summarizeAllSummarizedStats(stats) {
|
|
|
43
52
|
for (const [k, v] of stat.perSliceMeasurements.measurements) {
|
|
44
53
|
perSliceMeasurements.get(k).push(v);
|
|
45
54
|
}
|
|
55
|
+
for (const [k, v] of stat.additionalMeasurements ?? []) {
|
|
56
|
+
additionalMeasurements.get(k).push(Number(v));
|
|
57
|
+
}
|
|
58
|
+
retrieveTimesPer100Lines.push(stat.retrieveTimePer100Lines);
|
|
59
|
+
normalizeTimesPer100Lines.push(stat.normalizeTimePer100Lines);
|
|
60
|
+
dataflowTimesPer100Lines.push(stat.dataflowTimePer100Lines);
|
|
61
|
+
totalCommonTimesPer100Lines.push(stat.totalCommonTimePer100Lines);
|
|
62
|
+
if (stat.controlFlowTimePer100Lines !== undefined) {
|
|
63
|
+
controlFlowTimesPer100Lines.push(stat.controlFlowTimePer100Lines);
|
|
64
|
+
}
|
|
65
|
+
sliceTimesPer100Lines.push(stat.perSliceMeasurements.sliceTimePer100Lines);
|
|
66
|
+
reconstructTimesPer100Lines.push(stat.perSliceMeasurements.reconstructTimePer100Lines);
|
|
67
|
+
totalPerSliceTimesPer100Lines.push(stat.perSliceMeasurements.totalPerSliceTimePer100Lines);
|
|
46
68
|
sliceTimesPerToken.push(stat.perSliceMeasurements.sliceTimePerToken);
|
|
47
69
|
reconstructTimesPerToken.push(stat.perSliceMeasurements.reconstructTimePerToken);
|
|
48
70
|
totalPerSliceTimesPerToken.push(stat.perSliceMeasurements.totalPerSliceTimePerToken);
|
|
@@ -78,6 +100,7 @@ function summarizeAllSummarizedStats(stats) {
|
|
|
78
100
|
totalSlices: totalSlices,
|
|
79
101
|
commonMeasurements: new Map([...commonMeasurements.entries()].map(([k, v]) => [k, (0, summarizer_1.summarizeMeasurement)(v)])),
|
|
80
102
|
perSliceMeasurements: new Map([...perSliceMeasurements.entries()].map(([k, v]) => [k, (0, process_1.summarizeSummarizedMeasurement)(v)])),
|
|
103
|
+
additionalMeasurements: new Map([...additionalMeasurements.entries()].map(([k, v]) => [k, (0, summarizer_1.summarizeMeasurement)(v)])),
|
|
81
104
|
sliceTimePerToken: (0, process_1.summarizeSummarizedTimePerToken)(sliceTimesPerToken),
|
|
82
105
|
reconstructTimePerToken: (0, process_1.summarizeSummarizedTimePerToken)(reconstructTimesPerToken),
|
|
83
106
|
totalPerSliceTimePerToken: (0, process_1.summarizeSummarizedTimePerToken)(totalPerSliceTimesPerToken),
|
|
@@ -88,6 +111,14 @@ function summarizeAllSummarizedStats(stats) {
|
|
|
88
111
|
controlFlowTimePerToken: controlFlowTimePerToken.length > 0 ? (0, process_1.summarizeTimePerToken)(controlFlowTimePerToken) : undefined,
|
|
89
112
|
callGraphTimePerToken: callGraphTimePerToken.length > 0 ? (0, process_1.summarizeTimePerToken)(callGraphTimePerToken) : undefined,
|
|
90
113
|
dataFrameShapeTimePerToken: dataFrameShapeTimePerToken.length > 0 ? (0, process_1.summarizeTimePerToken)(dataFrameShapeTimePerToken) : undefined,
|
|
114
|
+
retrieveTimePer100Lines: (0, summarizer_1.summarizeMeasurement)(retrieveTimesPer100Lines),
|
|
115
|
+
normalizeTimePer100Lines: (0, summarizer_1.summarizeMeasurement)(normalizeTimesPer100Lines),
|
|
116
|
+
dataflowTimePer100Lines: (0, summarizer_1.summarizeMeasurement)(dataflowTimesPer100Lines),
|
|
117
|
+
totalCommonTimePer100Lines: (0, summarizer_1.summarizeMeasurement)(totalCommonTimesPer100Lines),
|
|
118
|
+
controlFlowTimePer100Lines: controlFlowTimesPer100Lines.length > 0 ? (0, summarizer_1.summarizeMeasurement)(controlFlowTimesPer100Lines) : undefined,
|
|
119
|
+
sliceTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(sliceTimesPer100Lines),
|
|
120
|
+
reconstructTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(reconstructTimesPer100Lines),
|
|
121
|
+
totalPerSliceTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(totalPerSliceTimesPer100Lines),
|
|
91
122
|
failedToRepParse,
|
|
92
123
|
timesHitThreshold,
|
|
93
124
|
reduction: (0, process_1.summarizeSummarizedReductions)(reductions),
|
|
@@ -111,6 +142,11 @@ function summarizeAllSummarizedStats(stats) {
|
|
|
111
142
|
numberOfEdges: (0, summarizer_1.summarizeMeasurement)(dataflows.map(d => d.numberOfEdges)),
|
|
112
143
|
sizeOfObject: (0, summarizer_1.summarizeMeasurement)(dataflows.map(d => d.sizeOfObject)),
|
|
113
144
|
},
|
|
145
|
+
controlFlow: stats.some(s => s.controlFlow !== undefined) ? {
|
|
146
|
+
numberOfVertices: (0, summarizer_1.summarizeMeasurement)(stats.map(s => s.controlFlow?.numberOfVertices).filter(assert_1.isNotUndefined)),
|
|
147
|
+
numberOfEdges: (0, summarizer_1.summarizeMeasurement)(stats.map(s => s.controlFlow?.numberOfEdges).filter(assert_1.isNotUndefined)),
|
|
148
|
+
sizeOfObject: (0, summarizer_1.summarizeMeasurement)(stats.map(s => s.controlFlow?.sizeOfObject).filter(assert_1.isNotUndefined))
|
|
149
|
+
} : undefined,
|
|
114
150
|
dataFrameShape: stats.some(s => s.dataFrameShape !== undefined) ? {
|
|
115
151
|
numberOfDataFrameFiles: (0, arrays_1.arraySum)(stats.map(s => s.dataFrameShape?.numberOfDataFrameFiles).filter(assert_1.isNotUndefined)),
|
|
116
152
|
numberOfNonDataFrameFiles: (0, arrays_1.arraySum)(stats.map(s => s.dataFrameShape?.numberOfNonDataFrameFiles).filter(assert_1.isNotUndefined)),
|
|
@@ -167,6 +203,7 @@ function summarizeAllUltimateStats(stats) {
|
|
|
167
203
|
// average out / summarize other measurements
|
|
168
204
|
commonMeasurements: new Map(stats_1.CommonSlicerMeasurements.filter(m => stats.some(s => s.commonMeasurements.has(m))).map(m => [m, (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.commonMeasurements.get(m)))])),
|
|
169
205
|
perSliceMeasurements: new Map(stats_1.PerSliceMeasurements.map(m => [m, (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.perSliceMeasurements.get(m)))])),
|
|
206
|
+
additionalMeasurements: new Map(stats_1.AdditionalSlicerMeasurements.filter(m => stats.some(s => s.additionalMeasurements?.has(m))).map(m => [m, (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.additionalMeasurements?.get(m)).filter(assert_1.isNotUndefined))])),
|
|
170
207
|
sliceTimePerToken: (0, process_1.summarizeSummarizedTimePerToken)(stats.map(s => s.sliceTimePerToken)),
|
|
171
208
|
reconstructTimePerToken: (0, process_1.summarizeSummarizedTimePerToken)(stats.map(s => s.reconstructTimePerToken)),
|
|
172
209
|
totalPerSliceTimePerToken: (0, process_1.summarizeSummarizedTimePerToken)(stats.map(s => s.totalPerSliceTimePerToken)),
|
|
@@ -176,6 +213,14 @@ function summarizeAllUltimateStats(stats) {
|
|
|
176
213
|
totalCommonTimePerToken: (0, process_1.summarizeSummarizedTimePerToken)(stats.map(s => s.totalCommonTimePerToken)),
|
|
177
214
|
controlFlowTimePerToken: stats.some(s => s.controlFlowTimePerToken !== undefined) ? (0, process_1.summarizeSummarizedTimePerToken)(stats.map(s => s.controlFlowTimePerToken).filter(assert_1.isNotUndefined)) : undefined,
|
|
178
215
|
dataFrameShapeTimePerToken: stats.some(s => s.dataFrameShapeTimePerToken !== undefined) ? (0, process_1.summarizeSummarizedTimePerToken)(stats.map(s => s.dataFrameShapeTimePerToken).filter(assert_1.isNotUndefined)) : undefined,
|
|
216
|
+
retrieveTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.retrieveTimePer100Lines).filter(assert_1.isNotUndefined)),
|
|
217
|
+
normalizeTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.normalizeTimePer100Lines).filter(assert_1.isNotUndefined)),
|
|
218
|
+
dataflowTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflowTimePer100Lines).filter(assert_1.isNotUndefined)),
|
|
219
|
+
totalCommonTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.totalCommonTimePer100Lines).filter(assert_1.isNotUndefined)),
|
|
220
|
+
controlFlowTimePer100Lines: stats.some(s => s.controlFlowTimePer100Lines !== undefined) ? (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.controlFlowTimePer100Lines).filter(assert_1.isNotUndefined)) : undefined,
|
|
221
|
+
sliceTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.sliceTimePer100Lines).filter(assert_1.isNotUndefined)),
|
|
222
|
+
reconstructTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.reconstructTimePer100Lines).filter(assert_1.isNotUndefined)),
|
|
223
|
+
totalPerSliceTimePer100Lines: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.totalPerSliceTimePer100Lines).filter(assert_1.isNotUndefined)),
|
|
179
224
|
reduction: (0, process_1.summarizeSummarizedReductions)(stats.map(s => s.reduction)),
|
|
180
225
|
reductionNoFluff: (0, process_1.summarizeSummarizedReductions)(stats.map(s => s.reductionNoFluff)),
|
|
181
226
|
input: {
|
|
@@ -197,6 +242,11 @@ function summarizeAllUltimateStats(stats) {
|
|
|
197
242
|
numberOfEdges: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflow.numberOfEdges)),
|
|
198
243
|
sizeOfObject: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.dataflow.sizeOfObject)),
|
|
199
244
|
},
|
|
245
|
+
controlFlow: stats.some(s => s.controlFlow !== undefined) ? {
|
|
246
|
+
numberOfVertices: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.controlFlow?.numberOfVertices).filter(assert_1.isNotUndefined)),
|
|
247
|
+
numberOfEdges: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.controlFlow?.numberOfEdges).filter(assert_1.isNotUndefined)),
|
|
248
|
+
sizeOfObject: (0, process_1.summarizeSummarizedMeasurement)(stats.map(s => s.controlFlow?.sizeOfObject).filter(assert_1.isNotUndefined))
|
|
249
|
+
} : undefined,
|
|
200
250
|
dataFrameShape: stats.some(s => s.dataFrameShape !== undefined) ? {
|
|
201
251
|
numberOfDataFrameFiles: (0, arrays_1.arraySum)(stats.map(s => s.dataFrameShape?.numberOfDataFrameFiles).filter(assert_1.isNotUndefined)),
|
|
202
252
|
numberOfNonDataFrameFiles: (0, arrays_1.arraySum)(stats.map(s => s.dataFrameShape?.numberOfNonDataFrameFiles).filter(assert_1.isNotUndefined)),
|
|
@@ -256,6 +306,11 @@ function processNextSummary(line, allSummarized) {
|
|
|
256
306
|
(0, assert_1.guard)(v.endsWith('n'), 'Expected a bigint');
|
|
257
307
|
return [k, BigInt(v.slice(0, -1))];
|
|
258
308
|
})),
|
|
309
|
+
additionalMeasurements: new Map((got.summarize.additionalMeasurements ?? [])
|
|
310
|
+
.map(([k, v]) => {
|
|
311
|
+
(0, assert_1.guard)(v.endsWith('n'), 'Expected a bigint');
|
|
312
|
+
return [k, BigInt(v.slice(0, -1))];
|
|
313
|
+
})),
|
|
259
314
|
perSliceMeasurements: {
|
|
260
315
|
...got.summarize.perSliceMeasurements,
|
|
261
316
|
// restore maps
|
|
@@ -279,6 +334,7 @@ function processNextUltimateSummary(line, allSummarized) {
|
|
|
279
334
|
// restore maps
|
|
280
335
|
commonMeasurements: new Map(got.commonMeasurements),
|
|
281
336
|
perSliceMeasurements: new Map(got.perSliceMeasurements),
|
|
337
|
+
additionalMeasurements: new Map(got.additionalMeasurements ?? []),
|
|
282
338
|
dataFrameShape: got.dataFrameShape !== undefined ? {
|
|
283
339
|
...got.dataFrameShape,
|
|
284
340
|
perOperationNumber: new Map(got.dataFrameShape.perOperationNumber)
|
|
@@ -44,7 +44,6 @@ class BenchmarkSummarizer extends summarizer_1.Summarizer {
|
|
|
44
44
|
}
|
|
45
45
|
this.log('Done summarizing');
|
|
46
46
|
}
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/require-await -- just to obey the structure
|
|
48
47
|
async summarizePhase() {
|
|
49
48
|
this.log(`Summarizing all summaries from ${this.summaryFile()}...`);
|
|
50
49
|
this.removeIfExists(this.config.outputPath);
|
|
@@ -55,7 +54,7 @@ class BenchmarkSummarizer extends summarizer_1.Summarizer {
|
|
|
55
54
|
fs_1.default.writeFileSync(this.config.outputPath, JSON.stringify(ultimate, json_1.jsonReplacer));
|
|
56
55
|
console.log((0, print_1.ultimateStats2String)(ultimate));
|
|
57
56
|
if (this.config.graphOutputPath) {
|
|
58
|
-
(0, graph_1.writeGraphOutput)(ultimate, this.config.graphOutputPath);
|
|
57
|
+
await (0, graph_1.writeGraphOutput)(ultimate, this.config.graphOutputPath);
|
|
59
58
|
}
|
|
60
59
|
return ultimate;
|
|
61
60
|
}
|
package/cli/benchmark-app.d.ts
CHANGED
package/cli/benchmark-app.js
CHANGED
|
@@ -76,7 +76,8 @@ async function benchmark() {
|
|
|
76
76
|
'--sampling-strategy', options['sampling-strategy'],
|
|
77
77
|
...(options.seed ? ['--seed', options.seed] : []),
|
|
78
78
|
...(options.cfg ? ['--cfg'] : []),
|
|
79
|
-
...(options.cg ? ['--cg'] : [])
|
|
79
|
+
...(options.cg ? ['--cg'] : []),
|
|
80
|
+
...(options['no-extra-phases'] ? ['--no-extra-phases'] : [])
|
|
80
81
|
]);
|
|
81
82
|
const runs = options.runs ?? 1;
|
|
82
83
|
for (let i = 1; i <= runs; i++) {
|
|
@@ -73,8 +73,18 @@ async function benchmark() {
|
|
|
73
73
|
}
|
|
74
74
|
if (options['dataframe-shape-inference']) {
|
|
75
75
|
console.log(`${prefix} Performing shape inference for data frames`);
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
// the inference is not what the benchmark is about, so a failure costs its numbers and nothing else
|
|
77
|
+
try {
|
|
78
|
+
slicer.inferDataFrameShapes();
|
|
79
|
+
console.log(`${prefix} Completed data frame shape inference`);
|
|
80
|
+
}
|
|
81
|
+
catch (e) {
|
|
82
|
+
console.log(`${prefix} Skipping data frame shape inference: ${e instanceof Error ? e.message : String(e)}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
console.log(`${prefix} Measuring the additional phases (dependencies query, linter, calibration)`);
|
|
86
|
+
if (!options['no-extra-phases']) {
|
|
87
|
+
await slicer.measureAdditionalPhases();
|
|
78
88
|
}
|
|
79
89
|
const { stats } = slicer.finish();
|
|
80
90
|
const output = {
|
package/cli/common/options.d.ts
CHANGED
|
@@ -109,6 +109,11 @@ export declare const benchmarkOptions: [{
|
|
|
109
109
|
readonly name: "cg";
|
|
110
110
|
readonly type: BooleanConstructor;
|
|
111
111
|
readonly description: "Extract the call graph of the file (benchmark it too)";
|
|
112
|
+
}, {
|
|
113
|
+
readonly name: "no-extra-phases";
|
|
114
|
+
readonly type: BooleanConstructor;
|
|
115
|
+
readonly description: "Skip the dependencies query, the linter run and the calibration, which cost suite runtime";
|
|
116
|
+
readonly defaultValue: false;
|
|
112
117
|
}];
|
|
113
118
|
export declare const benchmarkHelperOptions: [{
|
|
114
119
|
readonly name: "verbose";
|
|
@@ -190,6 +195,11 @@ export declare const benchmarkHelperOptions: [{
|
|
|
190
195
|
readonly description: "Which strategy to use, when sampling is enabled";
|
|
191
196
|
readonly defaultValue: "random";
|
|
192
197
|
readonly typeLabel: "{underline random/equidistant}";
|
|
198
|
+
}, {
|
|
199
|
+
readonly name: "no-extra-phases";
|
|
200
|
+
readonly type: BooleanConstructor;
|
|
201
|
+
readonly description: "Skip the dependencies query, the linter run and the calibration, which cost suite runtime";
|
|
202
|
+
readonly defaultValue: false;
|
|
193
203
|
}, {
|
|
194
204
|
readonly name: "seed";
|
|
195
205
|
readonly type: StringConstructor;
|
package/cli/common/options.js
CHANGED
|
@@ -27,7 +27,8 @@ exports.benchmarkOptions = [
|
|
|
27
27
|
{ name: 'per-file-time-limit', type: Number, description: 'Time limit in milliseconds to process single file (disabled by default)', defaultValue: undefined, typeLabel: '{underline number}' },
|
|
28
28
|
{ name: 'sampling-strategy', type: String, description: 'Which strategy to use, when sampling is enabled', defaultValue: 'random', typeLabel: '{underline random/equidistant}' },
|
|
29
29
|
{ name: 'cfg', alias: 'c', type: Boolean, description: 'Extract the control flow graph of the file (benchmark it too)' },
|
|
30
|
-
{ name: 'cg', type: Boolean, description: 'Extract the call graph of the file (benchmark it too)' }
|
|
30
|
+
{ name: 'cg', type: Boolean, description: 'Extract the call graph of the file (benchmark it too)' },
|
|
31
|
+
{ name: 'no-extra-phases', type: Boolean, description: 'Skip the dependencies query, the linter run and the calibration, which cost suite runtime', defaultValue: false },
|
|
31
32
|
];
|
|
32
33
|
exports.benchmarkHelperOptions = [
|
|
33
34
|
{ name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging [do not use for the real benchmark as this affects the time measurements, but only to find errors]' },
|
|
@@ -44,6 +45,7 @@ exports.benchmarkHelperOptions = [
|
|
|
44
45
|
{ name: 'max-slices', type: Number, description: 'If file has more than passed number of slices, the file is not processed', defaultValue: -1, typeLabel: '{underline number}' },
|
|
45
46
|
{ name: 'threshold', alias: 't', type: Number, description: 'How many re-visits of the same node are ok?', defaultValue: undefined, typeLabel: '{underline number}' },
|
|
46
47
|
{ name: 'sampling-strategy', type: String, description: 'Which strategy to use, when sampling is enabled', defaultValue: 'random', typeLabel: '{underline random/equidistant}' },
|
|
48
|
+
{ name: 'no-extra-phases', type: Boolean, description: 'Skip the dependencies query, the linter run and the calibration, which cost suite runtime', defaultValue: false },
|
|
47
49
|
{ name: 'seed', type: String, description: 'The random seed for sampling the slicing criteria if a maximum is set' },
|
|
48
50
|
];
|
|
49
51
|
exports.exportQuadsOptions = [
|
|
@@ -224,6 +224,11 @@ declare const _scripts: {
|
|
|
224
224
|
readonly name: "cg";
|
|
225
225
|
readonly type: BooleanConstructor;
|
|
226
226
|
readonly description: "Extract the call graph of the file (benchmark it too)";
|
|
227
|
+
}, {
|
|
228
|
+
readonly name: "no-extra-phases";
|
|
229
|
+
readonly type: BooleanConstructor;
|
|
230
|
+
readonly description: "Skip the dependencies query, the linter run and the calibration, which cost suite runtime";
|
|
231
|
+
readonly defaultValue: false;
|
|
227
232
|
}];
|
|
228
233
|
};
|
|
229
234
|
'benchmark-helper': {
|
|
@@ -311,6 +316,11 @@ declare const _scripts: {
|
|
|
311
316
|
readonly description: "Which strategy to use, when sampling is enabled";
|
|
312
317
|
readonly defaultValue: "random";
|
|
313
318
|
readonly typeLabel: "{underline random/equidistant}";
|
|
319
|
+
}, {
|
|
320
|
+
readonly name: "no-extra-phases";
|
|
321
|
+
readonly type: BooleanConstructor;
|
|
322
|
+
readonly description: "Skip the dependencies query, the linter run and the calibration, which cost suite runtime";
|
|
323
|
+
readonly defaultValue: false;
|
|
314
324
|
}, {
|
|
315
325
|
readonly name: "seed";
|
|
316
326
|
readonly type: StringConstructor;
|
|
@@ -1,43 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.controlflowBbStarCommand = exports.controlflowBbCommand = exports.controlflowStarCommand = exports.controlflowCommand = void 0;
|
|
37
4
|
const cfg_1 = require("../../../util/mermaid/cfg");
|
|
38
5
|
const ansi_1 = require("../../../util/text/ansi");
|
|
39
6
|
const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
|
|
40
7
|
const core_1 = require("../core");
|
|
8
|
+
const repl_clipboard_1 = require("./repl-clipboard");
|
|
41
9
|
function formatInfo(out, type) {
|
|
42
10
|
return out.formatter.format(`Copied ${type} to clipboard.`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
43
11
|
}
|
|
@@ -45,15 +13,7 @@ async function produceAndPrintCfg(analyzer, output, simplifications, cfgConverte
|
|
|
45
13
|
const cfg = await analyzer.controlflow([...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications]);
|
|
46
14
|
const normalizedAst = await analyzer.normalize();
|
|
47
15
|
const mermaid = cfgConverter(cfg, normalizedAst);
|
|
48
|
-
|
|
49
|
-
if (output.allowClipboard !== false) {
|
|
50
|
-
try {
|
|
51
|
-
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
52
|
-
clipboard.default.writeSync(mermaid);
|
|
53
|
-
output.stdout(formatInfo(output, 'mermaid code'));
|
|
54
|
-
}
|
|
55
|
-
catch { /* do nothing this is a service thing */ }
|
|
56
|
-
}
|
|
16
|
+
await repl_clipboard_1.ReplClipboard.print(output, mermaid, formatInfo(output, 'mermaid code'));
|
|
57
17
|
}
|
|
58
18
|
exports.controlflowCommand = {
|
|
59
19
|
description: 'Get mermaid code for the control-flow graph of R code',
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ReplOutput } from './repl-main';
|
|
2
|
+
/** Output that the user most likely wants on their clipboard as well. */
|
|
3
|
+
export declare const ReplClipboard: {
|
|
4
|
+
readonly name: "ReplClipboard";
|
|
5
|
+
/** Prints `text` and, if the output allows it, copies it to the clipboard and reports `note` afterwards. */
|
|
6
|
+
readonly print: (this: void, output: ReplOutput, text: string, note: string) => Promise<void>;
|
|
7
|
+
};
|