{"id":149,"date":"2011-01-16T15:59:11","date_gmt":"2011-01-16T21:59:11","guid":{"rendered":"http:\/\/www.ancor.ch\/schoebey\/?p=149"},"modified":"2011-01-16T15:59:11","modified_gmt":"2011-01-16T21:59:11","slug":"performance-optimizations-and-code-structure-cleanup","status":"publish","type":"post","link":"https:\/\/www.ancor.ch\/schoebey\/?p=149","title":{"rendered":"performance optimizations and code-structure cleanup"},"content":{"rendered":"<h2>The problem<\/h2>\n<p>each object potentially carries one or more triggers.<\/p>\n<p>When evaluating triggers, this means iterating through every object available and test for any triggers. That&#8217;s the na\u00c3\u00afve approach and has a huge drawback: only a tiny subset of the available objects are interactive and actually carry triggers.<\/p>\n<p>Having to check every single object is a big performance hit, since we&#8217;re performing 99% of unnecessary checks.<\/p>\n<h2>The solution<\/h2>\n<h3>Triggers<\/h3>\n<p>Since the introduction of the action- and trigger-manager classes, continuing to carry trigger-evaluation within the scenegraph-manager has become sub-optimal.<\/p>\n<p>The new approach would add a method to the trigger manager that checks all of its created triggers for any matches and, if applicable, fires them.<\/p>\n<p>Since any triggers are instanciated using the manager, we can store their pointers and evaluate them whenever necessary. This is the minimum effort needed for trigger evaluation: perform a check on every (active) trigger that is potentially able to fire.<\/p>\n<h3>Actions<\/h3>\n<p>A similar mechanism will be implemented in the action-manager: Blended actions shouldn&#8217;t be carried within the scenegraph-manager anymore, but should be managed by the action-manager from now on.<\/p>\n<p>Meaning whenever an action is triggered that is in &#8216;bleded&#8217; state, it is added to the action-manager&#8217;s internal processing list instead, leaving the scenegraph-manager with only having to call the action-manager&#8217;s new &#8216;process&#8217; method.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The problem each object potentially carries one or more triggers. When evaluating triggers, this means iterating through every object available and test for any triggers. That&#8217;s the na\u00c3\u00afve approach and has a huge drawback: only a tiny subset of the available objects are interactive and actually carry triggers. Having to check every single object is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[11,16,15,12,8,7,10],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-design","category-p407","tag-action","tag-brainstorming","tag-design","tag-management","tag-modularity","tag-optimization","tag-trigger"],"_links":{"self":[{"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=149"}],"version-history":[{"count":1,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":150,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=\/wp\/v2\/posts\/149\/revisions\/150"}],"wp:attachment":[{"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ancor.ch\/schoebey\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}