Skip to content

TS: only transfer offsets as part of the AST#529

Merged
semmle-qlci merged 1 commit into
github:masterfrom
asger-semmle:js-line-map
Nov 23, 2018
Merged

TS: only transfer offsets as part of the AST#529
semmle-qlci merged 1 commit into
github:masterfrom
asger-semmle:js-line-map

Conversation

@asger-semmle

Copy link
Copy Markdown
Contributor

The serialized TypeScript AST contains the start/end positions of all AST nodes. Each position was encoded as an object of form {line, character, $offset}. Having two of those per AST node accounted for quite a bit of the serialization overhead.

We now only send the offset as a number, and compute the corresponding line/character in the Java side.

Some timings:

before after difference
vscode 149s 128s 14%
TypeScript 64s 59s 9%
angular 113s 111s 2%

The angular runs were a bit flaky, but the others are consistently faster.

@asger-semmle asger-semmle requested a review from a team as a code owner November 22, 2018 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants