-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: construct children collection once * lint-fix: specify return type of isRoot directly * refactor: further performance & style improvements * refactor: helpless panic * refactor: another iteration of urgh * Revert "refactor: another iteration of urgh" This reverts commit e0bf428. * refactor: swapping tries for gods sake * Revert "refactor: swapping tries for gods sake" This reverts commit b77cebe. * Reapply "refactor: another iteration of urgh" This reverts commit 63c19a2. * refactor(wip): interim mental breakdown * refactor: at least... happy tests? * refactor: lock jsonlite options * refactor(cfg-test): remove fake test * refactor: try manual conversion, is worse * Revert "refactor: try manual conversion, is worse" This reverts commit 578c64e. * refactor: simplify json conversion * refactor: several minor performance tunes :3 * refactor: ensure the executor dies directly (and gracefully) * refactor: dynamic `flowr_get` compile * refactor: fine-tune cmp retrieval * refactor: reduce size of json produce, defer obj map to flowR * doc(test): remove dead jsdoc comment * refactor: clean up tmp logfiles * lint-fix: handle minor linter problems * refactor: wordly clean-up * feat: jsonlite begone! * refactor: further improve print-out-performance * refactor: always compile seems to be faster! * refactor: use build for benchmark run * refactor: switch back to `sort` * feat(tests): cover for optional xmlparsedata availability --------- Co-authored-by: Florian Sihler <florian.sihler@uni-ulm.de>
- Loading branch information
1 parent
96bbd86
commit bfd8f12
Showing
51 changed files
with
255 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export * from './model' | ||
export * from './parser/xml' | ||
export {parseLog} from './parser/csv/parser' | ||
export {parseLog} from './parser/json/parser' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { removeTokenMapQuotationMarks } from '../../../../retriever' | ||
import { guard } from '../../../../../util/assert' | ||
|
||
export const RootId = 0 | ||
|
||
export interface Entry extends Record<string, unknown> { | ||
line1: number, | ||
col1: number, | ||
line2: number, | ||
col2: number, | ||
id: number, | ||
parent: number, | ||
token: string, | ||
terminal: boolean, | ||
text: string, | ||
children?: Entry[] | ||
} | ||
|
||
type ParsedDataRow = [line1: number, col1: number, line2: number, col2: number, id: number, parent: number, token: string, terminal: boolean, text: string] | ||
|
||
export function prepareParsedData(data: string): Map<number, Entry> { | ||
const json: unknown = JSON.parse(data) | ||
guard(Array.isArray(json), () => `Expected ${data} to be an array but was not`) | ||
|
||
const ret = new Map<number, Entry>((json as ParsedDataRow[]).map(([line1, col1, line2, col2, id, parent, token, terminal, text]) => { | ||
return [id, { line1, col1, line2, col2, id, parent, token: removeTokenMapQuotationMarks(token), terminal, text }] satisfies [number, Entry] | ||
})) | ||
|
||
// iterate a second time to set parent-child relations (since they may be out of order in the csv) | ||
for(const entry of ret.values()) { | ||
if(entry.parent != RootId) { | ||
const parent = ret.get(entry.parent) | ||
if(parent) { | ||
parent.children ??= [] | ||
parent.children.push(entry) | ||
} | ||
} | ||
} | ||
|
||
return ret | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
bfd8f12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"artificial" Benchmark Suite
Total per-file
1516.6973344545454
ms (3765.211119967862
)1511.494083
ms (3708.3225553463017
)1.00
Retrieve AST from R code
307.00354272727276
ms (261.0172798892817
)64.46248863636363
ms (125.66414120100016
)4.76
Normalize R AST
33.07620031818182
ms (64.09281603038194
)94.99519236363636
ms (152.9376581920758
)0.35
Produce dataflow information
70.26002963636364
ms (175.12875389336065
)65.2556795909091
ms (167.18441854609554
)1.08
Total per-slice
1.8461127814688914
ms (1.337637708289551
)1.8724288794806876
ms (1.3873679811565907
)0.99
Static slicing
1.3818304625094695
ms (1.2825199074357059
)1.4074784311593942
ms (1.3118563756339259
)0.98
Reconstruct code
0.45033915063385405
ms (0.19568096194174467
)0.4524929302663976
ms (0.22636683004337768
)1.00
failed to reconstruct/re-parse
0
#0
#1
times hit threshold
0
#0
#1
reduction (characters)
0.7329390759026896
#0.7329390759026896
#1
reduction (normalized tokens)
0.7209834969577295
#0.720988345209971
#1.00
This comment was automatically generated by workflow using github-action-benchmark.
bfd8f12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark '"artificial" Benchmark Suite'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
2
.Retrieve AST from R code
307.00354272727276
ms (261.0172798892817
)64.46248863636363
ms (125.66414120100016
)4.76
This comment was automatically generated by workflow using github-action-benchmark.
bfd8f12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"social-science" Benchmark Suite
Total per-file
3707.1666103000002
ms (6215.042229911342
)3566.86774236
ms (5920.286185213901
)1.04
Retrieve AST from R code
314.40706378
ms (119.16372206117796
)72.22227936
ms (60.97026629229811
)4.35
Normalize R AST
34.71123942
ms (30.592799884980952
)113.02594858
ms (70.71306906384982
)0.31
Produce dataflow information
184.95076519999998
ms (282.02234968397937
)163.44175874
ms (276.9623037407309
)1.13
Total per-slice
9.105993052874766
ms (14.934544115063787
)8.599255365044066
ms (14.312877376595168
)1.06
Static slicing
8.59434534848267
ms (14.811448973463916
)8.071953766135923
ms (14.188089279803133
)1.06
Reconstruct code
0.5026473785153759
ms (0.23981576556699372
)0.5187709959800451
ms (0.27627204677573897
)0.97
failed to reconstruct/re-parse
9
#9
#1
times hit threshold
967
#967
#1
reduction (characters)
0.8935817303062393
#0.898713819973478
#0.99
reduction (normalized tokens)
0.8531248144961374
#0.8579790415512589
#0.99
This comment was automatically generated by workflow using github-action-benchmark.
bfd8f12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark '"social-science" Benchmark Suite'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
2
.Retrieve AST from R code
314.40706378
ms (119.16372206117796
)72.22227936
ms (60.97026629229811
)4.35
This comment was automatically generated by workflow using github-action-benchmark.