danielgmyers / flux-swf-client

Apache License 2.0
9 stars 3 forks source link

Only track the latest PartitionState for each partition, plus the initial attempt time. #43

Closed danielgmyers closed 2 years ago

danielgmyers commented 2 years ago

This change reduces memory allocations when building the WorkflowState object, particularly when a step had a large number of retries. This was accomplished in two ways:

For a workflow that had a step with 1000 retries, these changes reduce memory allocations during WorkflowState.build() by about 75%.

I also moved the workflow cancellation handling into one place instead of being split across three different methods.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

danielgmyers commented 2 years ago

Someone pointed out to me that a newer version of the AWS SDK fixes the enum issue, so I'm reverting the eventType() related changes in favor of just updating our SWF SDK to a newer version.