{"action":"opened","issue":{"url":"https://api.github.com/repos/openlvc/disco/issues/1","labels_url":"https://api.github.com/repos/openlvc/disco/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/openlvc/disco/issues/1/comments","events_url":"https://api.github.com/repos/openlvc/disco/issues/1/events","html_url":"https://github.com/openlvc/disco/issues/1","id":121420046,"number":1,"title":"Add support for Pull Parsing","user":{"login":"timpokorny","id":912209,"avatar_url":"https://avatars.githubusercontent.com/u/912209?v=3","gravatar_id":"","url":"https://api.github.com/users/timpokorny","html_url":"https://github.com/timpokorny","followers_url":"https://api.github.com/users/timpokorny/followers","following_url":"https://api.github.com/users/timpokorny/following{/other_user}","gists_url":"https://api.github.com/users/timpokorny/gists{/gist_id}","starred_url":"https://api.github.com/users/timpokorny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timpokorny/subscriptions","organizations_url":"https://api.github.com/users/timpokorny/orgs","repos_url":"https://api.github.com/users/timpokorny/repos","events_url":"https://api.github.com/users/timpokorny/events{/privacy}","received_events_url":"https://api.github.com/users/timpokorny/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/openlvc/disco/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-12-10T07:12:11Z","updated_at":"2015-12-10T07:12:11Z","closed_at":null,"body":"Story\r\n----\r\n**{As a}** sim developer with a penchant for speed,\r\n**{I want}** lazy pull parsing support,\r\n**{So that I can}** only take a packet-parsing performance hit for the bits that I actually care about\r\n \r\nContext\r\n----\r\nAs part of updates for Cost Counter I have been looking at different optimizations that can be done to the DIS parsing to speed things up. For the most part, spreading the load over multiple threads has worked fine, but there is scope for further speedup. As we are only pulling out a small amount of data for CC, one idea is to implement \"pull parsing\".\r\n\r\nConcept is that rather than deserializing on reception, we just wrap the incoming `byte[]` and continue with processing. Later on, when someone calls a method for a particular field, we lazy-load it. Take the hit the first time someone makes the call so that we're only working on the bits and pieces that we know the application cares about. Lazy loading would ensure there is no penalty for the second call.\r\n\r\nWould have to augment with a method to fully deserialize a packet so that it is easy to do if the need arises. Could also set the lazy-loading mode as a configuration option.\r\n\r\nAcceptance Criteria\r\n----\r\nOnce complete, the system shall:\r\n - [ ] Configuration option will be present to use aggressive or lazy parsing\r\n - [ ] When lazy parsing enabled, fields would only be deseralized when someone made a call to `getXxx()` for the particular field\r\n - [ ] Lazy loading would ensure there is no penalty for calling an accessor 2+ times\r\n"}}