Skip to content

<While> condition is checked too often #1342

Open
@tfranzer

Description

@tfranzer

Describe the bug
Having a While loop in the workflow will create the While primitive multiple times, including checking the condition (which might be a performance hit)

To Reproduce
Run Sample10, add console outputs in a While ctor and the getter/setter of the Data.Counter
Output will be like this

Starting workflow...
Write Counter 0
Hello
While ctor
Read Counter 0
While ctor
Read Counter 0
Doing something...
While ctor
Read Counter 0
Read Counter 0
Write Counter 1
While ctor
Read Counter 1
While ctor
Read Counter 1
While ctor
Read Counter 1
Doing something...
While ctor
Read Counter 1
Read Counter 1
Write Counter 2
While ctor
Read Counter 2
While ctor
Read Counter 2
While ctor
Read Counter 2
Doing something...
While ctor
Read Counter 2
Read Counter 2
Write Counter 3
While ctor
Read Counter 3
While ctor
Read Counter 3
Goodbye

Expected behavior
A check for the while condition should be done once per loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions