{"id":183,"date":"2013-04-19T16:01:08","date_gmt":"2013-04-19T21:01:08","guid":{"rendered":"http:\/\/homepages.uc.edu\/~yaozo\/wordpress\/?p=183"},"modified":"2013-04-19T16:01:08","modified_gmt":"2013-04-19T21:01:08","slug":"how-to-get-data-from-visum-com-object-fast-test-of-various-ways","status":"publish","type":"post","link":"https:\/\/zhuoyao.net\/index.php\/2013\/04\/19\/how-to-get-data-from-visum-com-object-fast-test-of-various-ways\/","title":{"rendered":"How to get data from Visum COM object fast &#8211; test of various ways."},"content":{"rendered":"<p><b>There&#8217;s at least some ways that data from Visum can be donwloaded to COM object.<\/b><br \/>\n<b>To see which one is the fastest I carried out this test.<\/b><\/p>\n<p>On basic network of 81 nodes I tested times to download the node data.<br \/>\nAs results for single operation were unstable I carried the simulations in a loop and tested mean values (1000 iterations).<br \/>\nI&#8217;ve tested following ways to download data:<br \/>\n1. \u00a0Visum.Net.Nodes.ItemByKey(1).AttValue(&#8220;No&#8221;)<br \/>\n2. \u00a0\u00a0for i in range(1,81):\u00a0Visum.Net.Nodes.ItemByKey(1).AttValue(&#8220;No&#8221;)<br \/>\n3. \u00a0 Visum.Net.Nodes.GetMultiAttValues(&#8216;No&#8217;)<br \/>\n4. \u00a0 Visum.Net.Nodes.GetMultipleAttributes([&#8220;No&#8221;,&#8221;Code&#8221;,&#8221;Name&#8221;,&#8221;AddVal1&#8243;,&#8221;AddVal2&#8243;,&#8221;AddVal3&#8243;])<br \/>\n5. \u00a0List=Visum.Lists.CreateNodeList;<\/p>\n<p><b>So the results I got from Python were:<\/b><br \/>\nItemByKey Node &#8216;No&#8217; Single: \u00a0 \u00a0 \u00a0 \u00a0 0.0022 [s]<br \/>\nItemByKey Node &#8216;No&#8217; 81 nodes : \u00a0 \u00a0 \u00a00.1236\u00a0[s]<br \/>\nItemByKey Node GetMultiAttValues: \u00a0 0.0020\u00a0[s]<br \/>\nGetMultipleAttributes : \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 0.0042\u00a0[s]<br \/>\nCreate list: \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a00.0082\u00a0[s]<br \/>\n<b><br \/>\n<\/b><br \/>\n<b>\u00a0 Comment:<\/b><br \/>\n1. Best way to get single element value: just use ItemByKey(key).AttValue()<br \/>\n2. However putting this procedure into a loop is not a reasonable way to get data of each elements,<br \/>\n3. as bulk download for whole container (GetMulti)\u00a0 is way faster (actually comparable time to get parameter value for single node than for 81 nodes).<br \/>\n4. Getting 7 attributes of 81 nodes is takes twice the time of single attribute.<br \/>\n5. Creating and downloading a list is twice longer than GetMulti (personally I use list to get data about paths, due to fact that GetMulti is not supported for paths).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s at least some ways that data from Visum can be donwloaded to COM object. To see which one is the fastest I carried out&hellip; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28],"tags":[],"class_list":["post-183","post","type-post","status-publish","format-standard","hentry","category-visum"],"_links":{"self":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":0,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuoyao.net\/index.php\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}