Skip to content

Conversation

@xiemaisi
Copy link

@xiemaisi xiemaisi commented Dec 3, 2018

As noted by Alex ET, this query has significantly regressed in performance from 1.18 on rhino. I can't immediately see any query or library changes that would have caused it, but it's not difficult to fix by refactoring the query; see first commit.

Looking at the results on rhino, I then noticed that the query was producing a humongous number of result links since it listed all calls to the function with new and all without, ballooning 17 alerts on rhino into >80K result tuples. The second commit fixes this by only showing one call with new and one without, picking the first one when sorted lexicographically by file name, line and column.

Comparing three versions of the query (before this PR, after the first commit, and after the second commit) shows no changes in alerts, and reasonable performance (internal link). Note that the table shows only the runtimes for the query itself, but I ran definitions.ql before to warm the cache. While some projects exhibit a slowdown of ten seconds or more, these are outliers, and worth the improved quality of results, I think.

Since this is a regression from 1.18, I'm proposing this as a hotfix.

Max Schaefer added 3 commits November 30, 2018 15:40
All the filtering is now done in `getALikelyCallee`, to which I have also added an additional parameter that improves the join in the `select` clause.

I've also simplified the alert message to no longer use `toString`, which isn't meant for alert messages anyway. (This is an old query.)
@xiemaisi xiemaisi added the JS label Dec 3, 2018
@xiemaisi xiemaisi added this to the 1.19 milestone Dec 3, 2018
@xiemaisi xiemaisi requested a review from a team as a code owner December 3, 2018 09:18
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except for the query message.

@ghost
Copy link

ghost commented Dec 3, 2018

This might not be tested with a dist-upgrade before the release, so ping @asger-semmle for a second review.

Copy link
Contributor

@asger-semmle asger-semmle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I gave it a brief read earlier with nothing to remark. LGTM

@xiemaisi
Copy link
Author

xiemaisi commented Dec 3, 2018

This might not be tested with a dist-upgrade before the release

We have one more distribution upgrade before the release (but of course more eyes are always good).

@semmle-qlci semmle-qlci merged commit 3d058a2 into github:rc/1.19 Dec 3, 2018
@xiemaisi xiemaisi deleted the js/fix-inconsistent-new branch January 10, 2019 16:26
cklin pushed a commit that referenced this pull request May 23, 2022
Add port of the existing compiler-tracing.spec files to the new Lua tracing infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants