Skip to content

Auto-rewrite associative DSL expression trees #7844

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Al2Klimov
Copy link
Member

@Al2Klimov Al2Klimov commented Feb 18, 2020

... if depth > log2(leaves) * 2 to reduce recursion and thereby avoid stack overflows.

fixes #7827
refs #7826
closes #7825

@Al2Klimov Al2Klimov self-assigned this Feb 18, 2020
@Al2Klimov Al2Klimov added this to the 2.13.0 milestone Feb 18, 2020
@Al2Klimov Al2Klimov force-pushed the feature/auto-rewrite-associative-dsl-7827 branch 5 times, most recently from 7e4a334 to 45e9b67 Compare February 18, 2020 10:13
@Al2Klimov
Copy link
Member Author

$ prefix/sbin/icinga2 console -x debug
Icinga 2 (version: v2.11.0-521-g45e9b67a9)
Type $help to view available commands.
<1> => 0 || 1
1.000000
<2> => 0 || 1 || 2
1.000000
<3> => 0 || 1 || 2 || 3
1.000000
<4> => 0 || 1 || 2 || 3 || 4
1.000000
<5> => 0 || 1 || 2 || 3 || 4 || 5
1.000000
<6> => 0 || 1 || 2 || 3 || 4 || 5 || 6
debug/config: Detected associative expression tree with 7 leaves, but 6 > log2(6) * 2 nesting levels. Rebalancing to log2(6) nesting levels.
Location: in <6>: 1:0-1:30
1.000000
<7> => 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7
debug/config: Detected associative expression tree with 7 leaves, but 6 > log2(6) * 2 nesting levels. Rebalancing to log2(6) nesting levels.
Location: in <7>: 1:0-1:30
1.000000
<8> => 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8
debug/config: Detected associative expression tree with 7 leaves, but 6 > log2(6) * 2 nesting levels. Rebalancing to log2(6) nesting levels.
Location: in <8>: 1:0-1:30
1.000000
<9> => 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9
debug/config: Detected associative expression tree with 7 leaves, but 6 > log2(6) * 2 nesting levels. Rebalancing to log2(6) nesting levels.
Location: in <9>: 1:0-1:30
1.000000
<10> => 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9 || 10
debug/config: Detected associative expression tree with 7 leaves, but 6 > log2(6) * 2 nesting levels. Rebalancing to log2(6) nesting levels.
Location: in <10>: 1:0-1:30
debug/config: Detected associative expression tree with 11 leaves, but 7 > log2(7) * 2 nesting levels. Rebalancing to log2(7) nesting levels.
Location: in <10>: 1:0-1:51
1.000000
<11> =>

@Al2Klimov Al2Klimov removed their assignment Feb 18, 2020
@Al2Klimov Al2Klimov marked this pull request as ready for review February 18, 2020 10:20
@Al2Klimov Al2Klimov force-pushed the feature/auto-rewrite-associative-dsl-7827 branch from 45e9b67 to e9e94ec Compare February 18, 2020 10:26
@Al2Klimov Al2Klimov force-pushed the feature/auto-rewrite-associative-dsl-7827 branch from e9e94ec to ea4e065 Compare December 14, 2020 17:50
@julianbrost julianbrost modified the milestones: 2.13.0, 2.14.0 May 31, 2021
@Al2Klimov
Copy link
Member Author

@cla-bot check

@cla-bot cla-bot bot added the cla/signed label Aug 4, 2021
@Al2Klimov Al2Klimov added the enhancement New feature or request label Aug 10, 2021
@julianbrost julianbrost removed this from the 2.14.0 milestone Feb 13, 2023
@Al2Klimov
Copy link
Member Author

@julianbrost I prefer this PR in favor of the OP-closes one. And you?

@Al2Klimov Al2Klimov force-pushed the feature/auto-rewrite-associative-dsl-7827 branch from ea4e065 to b2d114d Compare February 3, 2025 17:00
... if depth > log2(leaves) * 2 to reduce recursion
and thereby avoid stack overflows.

refs #7827
@Al2Klimov Al2Klimov force-pushed the feature/auto-rewrite-associative-dsl-7827 branch from b2d114d to 64d5010 Compare April 30, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla/signed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Associative DSL expressions should auto-rewrite themselves
2 participants