Skip to content

Java: avoid call to Location.toString() #13348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

nickrolfe
Copy link
Contributor

@nickrolfe nickrolfe commented Jun 1, 2023

Before

Most expensive predicates for completed query ExposeRepresentation.ql:
        time              | evals |   max @ iter | predicate
        ------------------|-------|--------------|----------
                    25.5s |       |              | Location#77b33c41::Location::toString#0#dispred#ff@7deb228l
                     6.3s |    75 |  2.1s @ 2    | ControlFlowGraph#5d746fff::ControlFlowGraphImpl::last#3#fff@f442bw2o

As well as being slow, this inserted the toUrl of every location into the string pool.

Evaluated non-recursive predicate Location#77b33c41::Location::toString#0#dispred#ff@7deb228l in 25496ms (size: 12294704).
Evaluated relational algebra for predicate Location#77b33c41::Location::toString#0#dispred#ff@7deb228l with tuple counts:
        12294704  ~0%    {2} r1 = SCAN Location#77b33c41::Location::hasLocationInfo#5#dispred#ffffff OUTPUT In.0, toUrl(In.1,In.2,In.3,In.4,In.5)
                         return r1

After

Most expensive predicates for completed query ExposeRepresentation.ql:
        time             | evals |   max @ iter | predicate
        -----------------|-------|--------------|----------
                    6.6s |    75 |  2.2s @ 2    | ControlFlowGraph#5d746fff::ControlFlowGraphImpl::last#3#fff@f442bw2o

@nickrolfe nickrolfe added the Java label Jun 1, 2023
@nickrolfe nickrolfe marked this pull request as ready for review June 2, 2023 10:21
@nickrolfe nickrolfe requested a review from a team as a code owner June 2, 2023 10:21
@alexet alexet added the no-change-note-required This PR does not need a change note label Jun 2, 2023
@nickrolfe nickrolfe added no-change-note-required This PR does not need a change note and removed no-change-note-required This PR does not need a change note labels Jun 2, 2023
@nickrolfe nickrolfe merged commit 6c5c338 into main Jun 6, 2023
@nickrolfe nickrolfe deleted the nickrolfe/java-location-tostring branch June 6, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants