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

DAML profiler: Evaluate arguments before open event #6234

Merged
merged 1 commit into from
Jun 5, 2020

Conversation

hurryabit
Copy link
Contributor

@hurryabit hurryabit commented Jun 4, 2020

This PR fixes a bug where the profiler wrote open events for functions
before evaluating their arguments. However, in a call-by-value
language such as DAML, arguments are evaluated before entering a
function and the profiler should reflect that.

This PR also adds a regression test.

CHANGELOG_BEGIN
CHANGELOG_END

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.


This change is Reviewable

This PR fixes a bug where the profiler wrote open events for functions
_before_ evaluating their arguments. However, in a call-by-value
language such as DAML, arguments are evaluated before entering a
function and the profiler should reflect that.

This PR also adds a regression test.

CHANGELOG_BEGIN
CHANGELOG_END
Copy link
Contributor

@shayne-fletcher shayne-fletcher left a comment

Choose a reason for hiding this comment

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

Well motivated and the implementation appears entirely reasonable.

Copy link
Contributor

@nickchapman-da nickchapman-da left a comment

Choose a reason for hiding this comment

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

Nice catch!
LGTM

@@ -731,16 +726,22 @@ object Speedy {
}

/** The function-closure and arguments have been evaluated. Now execute the body. */
final case class KFun(body: SExpr, frame: Frame, actuals: util.ArrayList[SValue])
final case class KFun(closure: PClosure, actuals: util.ArrayList[SValue])
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice. Embedding the PClosure in the KFun, instead of it's components.

@hurryabit hurryabit merged commit 27dcb1f into master Jun 5, 2020
@hurryabit hurryabit deleted the profiler-eval-args-before-open branch June 5, 2020 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants