Skip to content
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

Disable visualizations for subexpressions #11949

Merged

Conversation

hubertp
Copy link
Collaborator

@hubertp hubertp commented Dec 30, 2024

Pull Request Description

The possibility of attaching visualizations to subexpressions meant that we (currently) have to invalidate caches for their parent expression every time a request comes. That was an acceptable cost when an expression is relatively fast to compute but unacceptable when dealing with slow computations that would have to be repeated.

Since currently attaching visualizations is not used at all and we can rely on caching RHS and self, it is safe to disable it. An observable pattern is better suited for visualizations and would mitigate this problem by design, something that we planned for a while in #10525

Should help with long running visualizations in #11882. Partial visualization results should be addressed on GUI side.

Important Notes

For the example in #11882 we would at least re-read the large file at least twice, which adds 40-60seconds to the overall startup.

Exchanges before the change:
Screenshot from 2024-12-27 16-52-46

Responses after the change:
Screenshot from 2024-12-30 12-18-28

Results in the same (final) data:
Screenshot from 2024-12-30 12-24-02

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.

The possibility of attaching visualizations to subexpressions meant that
we (currently) have to invalidate caches for their parent expression
every time a request comes. That was an acceptable cost when an
expression is relatively fast to compute but unacceptable when dealing
with slow computations that would have to be repeated.
Since currently attaching visualizations is not used at all and we can
rely on caching RHS and self, it is _safe_ to disable it. An observable
pattern is better suited for visualizations and would mitigate this
problem by design.
@hubertp hubertp added the CI: No changelog needed Do not require a changelog entry for this PR. label Dec 30, 2024
@@ -484,6 +484,8 @@ class EnsureCompiledJob(
)
invalidatedVisualizations.foreach { visualization =>
UpsertVisualizationJob.upsertVisualization(visualization)
// Cache invalidation disabled because of #11882
// ctx.state.executionHooks.add(InvalidateCaches(visualization.expressionId))
Copy link
Contributor

Choose a reason for hiding this comment

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

yolo 🤠

@Frizi
Copy link
Contributor

Frizi commented Jan 1, 2025

Is this change meant to be temporary? It possibly violates assumptions made by the GUI team, since we assumed that we can attach visualizations to any arbitrary expression AST. Though I'm not exactly sure that it would actually breaks anything in practice right now. Could you write down some rules what is allowed/expected to work, so we can reference that in the future?

@hubertp
Copy link
Collaborator Author

hubertp commented Jan 2, 2025

Is this change meant to be temporary? It possibly violates assumptions made by the GUI team, since we assumed that we can attach visualizations to any arbitrary expression AST. Though I'm not exactly sure that it would actually breaks anything in practice right now. Could you write down some rules what is allowed/expected to work, so we can reference that in the future?

Yes, we will bring it back eventually. Right now it causes serious perf issues and we don't seem to use the arbitrary part so no reason to keep it around for the moment.

@hubertp hubertp added the CI: Ready to merge This PR is eligible for automatic merge label Jan 2, 2025
@mergify mergify bot merged commit 1f763f7 into develop Jan 2, 2025
47 of 50 checks passed
@mergify mergify bot deleted the wip/hubert/11882-disable-subexpressions-visualizations branch January 2, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants