Skip to content

Commit

Permalink
Simplify code in mutable
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelGarus committed Feb 22, 2023
1 parent 8f46458 commit ee5f5f6
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions packages/Core/mutable.candy
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,15 @@ inScope initialValue body :=
body requests.sendPort
requests.sendPort | channel.send Quit
}
finalValue = nursery | async {
recursive initialValue { recurse value ->
requests.receivePort | channel.receive %
(Get, answerPort) ->
needs (channel.isSendPort answerPort)
answerPort | channel.send value
recurse value
(Set, newValue) -> recurse newValue
Quit -> value
}
recursive initialValue { recurse value ->
requests.receivePort | channel.receive %
(Get, answerPort) ->
needs (channel.isSendPort answerPort)
answerPort | channel.send value
recurse value
(Set, newValue) -> recurse newValue
Quit -> value
}
await finalValue
}

set mutable newValue :=
Expand Down

2 comments on commit ee5f5f6

@jwbot
Copy link
Collaborator

@jwbot jwbot commented on ee5f5f6 Feb 22, 2023

Choose a reason for hiding this comment

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

Compiler

Benchmark suite Current: ee5f5f6 Previous: 0b21361 Ratio
Time: Compiler/hello_world 32682974 ns/iter (± 723508) 20562023 ns/iter (± 298456) 1.59
Time: Compiler/fibonacci 832954871 ns/iter (± 15884445) 533562236 ns/iter (± 2671183) 1.56
Time: VM Runtime/hello_world 23438087 ns/iter (± 653863) 15985931 ns/iter (± 430465) 1.47
Time: VM Runtime/fibonacci/15 210403150 ns/iter (± 1526280) 189734044 ns/iter (± 896423) 1.11

This comment was automatically generated by workflow using github-action-benchmark.

@jwbot
Copy link
Collaborator

@jwbot jwbot commented on ee5f5f6 Feb 22, 2023

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Compiler'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: ee5f5f6 Previous: 0b21361 Ratio
Time: Compiler/hello_world 32682974 ns/iter (± 723508) 20562023 ns/iter (± 298456) 1.59
Time: Compiler/fibonacci 832954871 ns/iter (± 15884445) 533562236 ns/iter (± 2671183) 1.56

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.