Title: Performance [P2]: Reduce orchestration history replay allocations · Issue #185 · microsoft/durabletask-python · GitHub
Open Graph Title: Performance [P2]: Reduce orchestration history replay allocations · Issue #185 · microsoft/durabletask-python
X Title: Performance [P2]: Reduce orchestration history replay allocations · Issue #185 · microsoft/durabletask-python
Description: What is the issue? Long orchestration histories are copied and scanned multiple times before and during replay. What is the impact? Replay CPU time and allocation pressure grow with history length. This can raise worker latency and reduc...
Open Graph Description: What is the issue? Long orchestration histories are copied and scanned multiple times before and during replay. What is the impact? Replay CPU time and allocation pressure grow with history length....
X Description: What is the issue? Long orchestration histories are copied and scanned multiple times before and during replay. What is the impact? Replay CPU time and allocation pressure grow with history length....
Opengraph URL: https://github.com/microsoft/durabletask-python/issues/185
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Performance [P2]: Reduce orchestration history replay allocations","articleBody":"### What is the issue?\n\nLong orchestration histories are copied and scanned multiple times before and during replay.\n\n### What is the impact?\n\nReplay CPU time and allocation pressure grow with history length. This can raise worker latency and reduce throughput for long-running orchestrations, particularly when many instances are replayed concurrently.\n\n### Details about the issue including code reference\n\nRelevant code:\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask/worker.py#L1135-L1143\n\nhttps://github.com/microsoft/durabletask-python/blob/55d8e0b413eb5dd75afa64f30c54fe300bf4ea21/durabletask/worker.py#L2135-L2187\n\n`TaskHubGrpcWorker._execute_orchestrator()` constructs `list(req.pastEvents) + list(req.newEvents)` only to find the execution-started event. `_OrchestrationExecutor.execute()` then builds a list of all execution-started events from `old_events`, scans new and old events for rewind state, and later replays all old events.\n\n### A potential or proposed solution\n\nUse lazy iteration (`itertools.chain`) for trace extraction and avoid materializing lists when only the first matching event is required. Consolidate metadata and rewind detection into minimal passes where semantics permit. Preserve rewind behavior, replay order, and non-determinism detection.","author":{"url":"https://github.com/berndverst","@type":"Person","name":"berndverst"},"datePublished":"2026-07-24T20:50:21Z","url":"https://github.com/microsoft/durabletask-python/issues/185"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:747d3977-665f-2bb4-57ba-a225a77bb4ad |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8092:14485C:17994A:1E69EC:6AFE44AC |
| html-safe-nonce | 6ace533d4388e0fe65b218e9973e1f662e81c98fdb0832e7059ffab566173500 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDkyOjE0NDg1QzoxNzk5NEE6MUU2OUVDOjZBRkU0NEFDIiwidmlzaXRvcl9pZCI6IjE5NDY3MTc5MTE4MDQ0Mjk0ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a10552db303ecac46082caf6df04a7838ee7f8c64ffd36f7243def60fc439fab |
| hovercard-subject-tag | issue:4971936616 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/durabletask-python/185/issue_layout |
| twitter:image | https://opengraph.githubassets.com/13754c55b8516693c8e1b835ed4b880f45d3f02edb70a9d76fa0e22b67426891/microsoft/durabletask-python/issues/185 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/13754c55b8516693c8e1b835ed4b880f45d3f02edb70a9d76fa0e22b67426891/microsoft/durabletask-python/issues/185 |
| og:image:alt | What is the issue? Long orchestration histories are copied and scanned multiple times before and during replay. What is the impact? Replay CPU time and allocation pressure grow with history length.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | berndverst |
| hostname | github.com |
| expected-hostname | github.com |
| None | f1a5901e2377b0af2a0b303f9528678f1475d04b9219dca1e993344196eaa07c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/durabletask-python git https://github.com/microsoft/durabletask-python.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 627664515 |
| octolytics-dimension-repository_nwo | microsoft/durabletask-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627664515 |
| octolytics-dimension-repository_network_root_nwo | microsoft/durabletask-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ce393ea11ad276623b946bc9663d3e7d6f564275 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width