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

Enable caching in visualization functions #3618

Merged
merged 16 commits into from Aug 10, 2022
Merged

Enable caching in visualization functions #3618

merged 16 commits into from Aug 10, 2022

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Jul 27, 2022

Pull Request Description

PR allows to attach metod pointers as a visualization expressions. This way it allows to attach a runtime instrument that enables caching of intermediate expressions.

Important Notes

ℹ️ API is backward compatible.

To attach the visualization with caching support, the same executionContext/attachVisualisation method is used, but VisualisationConfig message should contain the message pointer.
While VisualisationConfiguration message has changed, the language server accepts both new and old formats to keep visualisations working in IDE.

Old format

{
    "executionContextId": "UUID",
    "visualisationModule": "local.Unnamed.Main",
    "expression": "x -> x.to_text"
}

New format

{
    "executionContextId": "UUID",
    "expression": {
        "module": "local.Unnamed.Main",
        "definedOnType": "local.Unnamed.Main",
        "name": "encode"
    }
}

Checklist

Please include the following checklist in your PR:

  • The documentation has been updated if necessary.
  • All code conforms to the
    Scala,
    Java,
    and
    Rust
    style guides.
  • All code has been tested:
    • Unit tests have been written where possible.
    • If GUI codebase was changed: Enso GUI was tested when built using BOTH
      ./run ide dist and ./run ide watch.

@4e6 4e6 requested a review from wdanilo July 27, 2022 17:12
@4e6 4e6 self-assigned this Jul 27, 2022
@sylwiabr sylwiabr requested a review from hubertp July 28, 2022 05:54
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

I am surprised there is a change needed in the engine. Especially the change in callArguments in FunctionCallInstrumentationNode is surprising.

| y = x + 1
| encode y
|
|""".stripMargin.linesIterator.mkString("\n")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
|""".stripMargin.linesIterator.mkString("\n")
|""".stripMargin

isn't this bit spurious? This is equivalent, right?

@JaroslavTulach JaroslavTulach self-requested a review August 10, 2022 09:24
@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Aug 10, 2022
@mergify mergify bot merged commit 98d30bc into develop Aug 10, 2022
@mergify mergify bot deleted the wip/db/lazy-vis branch August 10, 2022 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants