-
Notifications
You must be signed in to change notification settings - Fork 610
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
perf(ir): avoid exponential growth on name
attribute access
#8445
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,3 +147,12 @@ def test_implicit_coercion_of_null_literal(op): | |
|
||
assert expr1.op() == expected | ||
assert expr2.op() == expected | ||
|
||
|
||
def test_nested_name_property(): | ||
x = ibis.literal(1) | ||
n = 100 | ||
for _ in range(n): # noqa: F402 | ||
x = x + 1 | ||
|
||
assert x.op().name.count("Add") == n | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cpcloud do we want to add some way of checking for recursion explosion? Maybe use n=200 and then test this doesn't take longer than 3 seconds to compute? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It didn't finish in any reasonable amount of time, so just having it as a standard unit test seems fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ahh, I see, so you would just notice it during local dev, no automation needed. Sure that works. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should turn this into
@attribute
in a follow-up since the.name
property is accessed multiple times during both construction and compilation.