Skip to content

Conversation

@MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Jul 1, 2022

This predicate has been popping in and out of the join-order badness report on Abseil for a while.

Before:

Tuple counts for UseInOwnInitializer::VariableAccessInInitializer#class#218a1892#bbf/3@c6f2f002 after 4.9s:
  1373964  ~3%     {2} r1 = JOIN Access::VariableAccess#8878f617#f WITH Access::Access::getTarget#dispred#f0820431#ff ON FIRST 1 OUTPUT Rhs.1 'var', Lhs.0 'this'
  
  0        ~0%     {3} r2 = JOIN r1 WITH initialisers_120#join_rhs ON FIRST 2 OUTPUT Lhs.1 'this', Lhs.0 'var', Rhs.2 'init'
  
  87097753 ~1%     {4} r3 = JOIN r1 WITH initialisers_102#join_rhs ON FIRST 1 OUTPUT Rhs.2, Lhs.1 'this', Lhs.0 'var', Rhs.1 'init'
  6        ~0%     {3} r4 = JOIN r3 WITH #Expr::Expr::getAChild#dispred#f0820431Plus#bf ON FIRST 2 OUTPUT Lhs.1 'this', Lhs.2 'var', Lhs.3 'init'
  
  6        ~0%     {3} r5 = r2 UNION r4
                    return r5
...
Tuple counts for UseInOwnInitializer::VariableAccessInInitializer::initializesItself#dispred#f0820431#fff/3@6277d4es after 0ms:
  6 ~0%     {3} r1 = JOIN Access::Access::getTarget#dispred#f0820431#ff WITH UseInOwnInitializer::VariableAccessInInitializer#class#218a1892#bbf ON FIRST 2 OUTPUT Lhs.0 'this', Lhs.1 'v', Rhs.2 'i'
            return r1

After:

Tuple counts for UseInOwnInitializer::VariableAccessInInitializer#218a1892#fff/3@57979eol after 104ms:
  254149 ~1%      {3} r1 = SCAN initialisers OUTPUT In.1 'var', In.0 'init', In.2 'this'
  236955 ~6%      {3} r2 = JOIN r1 WITH Variable::Variable#class#7a968d4e#b ON FIRST 1 OUTPUT Lhs.2 'this', Lhs.1 'init', Lhs.0 'var'
  
  41890  ~0%      {3} r3 = JOIN r2 WITH Access::VariableAccess#8878f617#f ON FIRST 1 OUTPUT Lhs.0 'this', Lhs.2 'var', Lhs.1 'init'
  
  578539 ~7%      {3} r4 = JOIN r2 WITH #Expr::Expr::getAChild#dispred#f0820431Plus#bf ON FIRST 1 OUTPUT Rhs.1 'this', Lhs.1 'init', Lhs.2 'var'
  180040 ~10%     {3} r5 = JOIN r4 WITH Access::VariableAccess#8878f617#f ON FIRST 1 OUTPUT Lhs.0 'this', Lhs.2 'var', Lhs.1 'init'
  
  221930 ~9%      {3} r6 = r3 UNION r5
                  return r6
...
Tuple counts for UseInOwnInitializer::VariableAccessInInitializer::initializesItself#dispred#f0820431#fff/3@c97e9c9f after 12ms:
  6      ~0%     {3} r1 = JOIN Access::Access::getTarget#dispred#f0820431#ff WITH UseInOwnInitializer::VariableAccessInInitializer#218a1892#fff ON FIRST 2 OUTPUT Lhs.0 'this', Lhs.1 'v', Rhs.2 'i'
                  return r1

Notice that the tuple count for initializesItself is identical.

@MathiasVP MathiasVP requested a review from a team as a code owner July 1, 2022 10:10
@github-actions github-actions bot added the C++ label Jul 1, 2022
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Jul 1, 2022
Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

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

LGTM, assuming DCA agrees.

@MathiasVP
Copy link
Contributor Author

The UseInOwnInitializer::VariableAccessInInitializer#class# predicate is now gone from both the join-order report, and the tuple-sum report 🎉.

@MathiasVP MathiasVP merged commit 3bacb18 into github:main Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C++ 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.

2 participants