{"action":"closed","issue":{"url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/667","repository_url":"https://api.github.com/repos/ClosedXML/ClosedXML","labels_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/667/labels{/name}","comments_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/667/comments","events_url":"https://api.github.com/repos/ClosedXML/ClosedXML/issues/667/events","html_url":"https://github.com/ClosedXML/ClosedXML/issues/667","id":291165865,"number":667,"title":"Calculation engine result caching","user":{"login":"igitur","id":145854,"avatar_url":"https://avatars1.githubusercontent.com/u/145854?v=4","gravatar_id":"","url":"https://api.github.com/users/igitur","html_url":"https://github.com/igitur","followers_url":"https://api.github.com/users/igitur/followers","following_url":"https://api.github.com/users/igitur/following{/other_user}","gists_url":"https://api.github.com/users/igitur/gists{/gist_id}","starred_url":"https://api.github.com/users/igitur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/igitur/subscriptions","organizations_url":"https://api.github.com/users/igitur/orgs","repos_url":"https://api.github.com/users/igitur/repos","events_url":"https://api.github.com/users/igitur/events{/privacy}","received_events_url":"https://api.github.com/users/igitur/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2018-01-24T10:58:27Z","updated_at":"2018-04-19T11:47:43Z","closed_at":"2018-04-19T11:47:43Z","author_association":"CONTRIBUTOR","body":"cc @Pankraty \r\n\r\nSome issues, e.g. #662 , are about the calculation engine being slow. This could be solved by\r\n- The calculation engine caching a cell's formula's result\r\n- The workbook directly loading and using the cached values that are stored in the file\r\n- The calculation engine implementing the calc chain (although I'm not convinced that the added complexity has any benefit).\r\n\r\nMy suggestion to fix this is:\r\n- Add optional load parameters to the `XLWorkbook` constructor. Similar to the `SaveOptions` structure that's used by `XLWorkbook.Save()`.\r\n- Add internals to `XLCell` for cached value (or use the existing `ValueCached`?) and a field/property for the date and time the formula was last calculated.\r\n- When cell's result is calculated, store it in the cache field and set date and time property to DateTime.Now.\r\n- When a cell value changes, invalidate all dependent cells - we should decide on whether to invalidate the whole dependency tree onwards.\r\n- Add `IXLWorkbook.RecalculateAllFormulas` and `IXLWorksheet.RecalculateAllFormulas` methods to invalidate and recalculate all cells in applicable scope.\r\n- Add new property in `SaveOptions` to optionally save cached results. Maybe replace the `EvaluateFormulas` property that's already in `SaveOptions`?\r\n\r\nMore to add?"}}
{"actor":{"display_login":"igitur"}}