{"action":"opened","issue":{"url":"https://api.github.com/repos/Mihara/RasterPropMonitor/issues/343","labels_url":"https://api.github.com/repos/Mihara/RasterPropMonitor/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/Mihara/RasterPropMonitor/issues/343/comments","events_url":"https://api.github.com/repos/Mihara/RasterPropMonitor/issues/343/events","html_url":"https://github.com/Mihara/RasterPropMonitor/issues/343","id":102531637,"number":343,"title":"Callback-based variable queries","user":{"login":"MOARdV","id":6089493,"avatar_url":"https://avatars.githubusercontent.com/u/6089493?v=3","gravatar_id":"","url":"https://api.github.com/users/MOARdV","html_url":"https://github.com/MOARdV","followers_url":"https://api.github.com/users/MOARdV/followers","following_url":"https://api.github.com/users/MOARdV/following{/other_user}","gists_url":"https://api.github.com/users/MOARdV/gists{/gist_id}","starred_url":"https://api.github.com/users/MOARdV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MOARdV/subscriptions","organizations_url":"https://api.github.com/users/MOARdV/orgs","repos_url":"https://api.github.com/users/MOARdV/repos","events_url":"https://api.github.com/users/MOARdV/events{/privacy}","received_events_url":"https://api.github.com/users/MOARdV/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Mihara/RasterPropMonitor/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"MOARdV","id":6089493,"avatar_url":"https://avatars.githubusercontent.com/u/6089493?v=3","gravatar_id":"","url":"https://api.github.com/users/MOARdV","html_url":"https://github.com/MOARdV","followers_url":"https://api.github.com/users/MOARdV/followers","following_url":"https://api.github.com/users/MOARdV/following{/other_user}","gists_url":"https://api.github.com/users/MOARdV/gists{/gist_id}","starred_url":"https://api.github.com/users/MOARdV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MOARdV/subscriptions","organizations_url":"https://api.github.com/users/MOARdV/orgs","repos_url":"https://api.github.com/users/MOARdV/repos","events_url":"https://api.github.com/users/MOARdV/events{/privacy}","received_events_url":"https://api.github.com/users/MOARdV/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-08-22T12:34:49Z","updated_at":"2015-08-22T12:34:49Z","closed_at":null,"body":"For the modules that query numeric values, would a callback method work better?  Example:\r\n\r\nJSIVariableAnimator calls comp.ProcessVariable potentially 3 times per Update call, per variable (assuming worst-case of using a named variable for each end of the range it's testing).  Each ProcessVariable call involves acquiring comp (dictionary search) and querying the variable (either computing it or doing another dictionary search).  Some variables are queried by many sources.  These searches add up computationally, and for some variables that don't update frequently (for example, CUSTOM_ALCOR_BACKLIGHT_ON), that's a lot of wasted cycles polling a rarely-changing value.  On the other hand, many of those props use a lower refreshRate (ignoring a number of update cycles before refreshing values).\r\n\r\nI imagine this is less valuable in an all-glass cockpit, since I don't see the callback system being usable on a monitor display (multiple variables per line).  It increases the memory footprint, since I'd have a list of callbacks per registered variable.  Prop updates would move to FixedUpdate (since that's when it makes sense, after I clear and recompute variables).  I may experiment with this to see if I can find a way to quantify its impact."}}