<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Speed of browse DataPanel from API in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10086154#M9399</link>
    <description>&lt;P&gt;Not sure if making the small adjustment in code as shown below speed up the performance by any value but may be worth to give a try. Thanks.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;	size_t projectsCount = app-&amp;gt;data()-&amp;gt;activeHub()-&amp;gt;dataProjects()-&amp;gt;count();
Ptr&amp;lt;DataProjects&amp;gt; projects = app-&amp;gt;data()-&amp;gt;activeHub()-&amp;gt;dataProjects(); 
for (size_t i = 0; i &amp;lt; projectsCount; i++)
	{
		proj ++;
		Ptr&amp;lt;DataProject&amp;gt; proj = projects-&amp;gt;item(i);
                size_t foldersCount = proj-&amp;gt;rootFolder()-&amp;gt;dataFolders()-&amp;gt;count();
		for (size_t ii = 0; ii &amp;lt; foldersCount; ii++)
		{
			fol++;
		}
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Feb 2021 07:48:05 GMT</pubDate>
    <dc:creator>goyals</dc:creator>
    <dc:date>2021-02-16T07:48:05Z</dc:date>
    <item>
      <title>Speed of browse DataPanel from API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10086122#M9398</link>
      <description>&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I have a question about the loading speed of the active Hub structure using the API, specifically C ++.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;There are 10 projects in my HUB and the sum of all directories on the first level of these projects is 19. Retrieving information about these numbers is 16 s when using the FOR loop and 21 s when using the FOREACH loop.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;I think both of these results are too long.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Because when browsing these HUBs directly from the FUSIONI360 environment, the reactions are fast.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="VIiyi"&gt;&lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Is it okay or I'm making a mistake somewhere.&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="JLqJ4b ChMk0b"&gt;&lt;SPAN&gt;Below is the code I use:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	app = Application::get();
	if (!app)
		return false;

	ui = app-&amp;gt;userInterface();
	if (!ui)
		return false;

	system_clock::time_point timeOfStart = system_clock::now();

	int fol = 0, proj = 0;

	for (size_t i = 0; i &amp;lt; app-&amp;gt;data()-&amp;gt;activeHub()-&amp;gt;dataProjects()-&amp;gt;count(); i++)
	{
		proj ++;
		Ptr&amp;lt;DataProject&amp;gt; proj = app-&amp;gt;data()-&amp;gt;activeHub()-&amp;gt;dataProjects()-&amp;gt;item(i);
		for (size_t ii = 0; ii &amp;lt; proj-&amp;gt;rootFolder()-&amp;gt;dataFolders()-&amp;gt;count(); ii++)
		{
			fol++;
		}
	}

	system_clock::time_point timeOfEnd = system_clock::now();&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 07:30:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10086122#M9398</guid>
      <dc:creator>-pezi-</dc:creator>
      <dc:date>2021-02-16T07:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Speed of browse DataPanel from API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10086154#M9399</link>
      <description>&lt;P&gt;Not sure if making the small adjustment in code as shown below speed up the performance by any value but may be worth to give a try. Thanks.&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;	size_t projectsCount = app-&amp;gt;data()-&amp;gt;activeHub()-&amp;gt;dataProjects()-&amp;gt;count();
Ptr&amp;lt;DataProjects&amp;gt; projects = app-&amp;gt;data()-&amp;gt;activeHub()-&amp;gt;dataProjects(); 
for (size_t i = 0; i &amp;lt; projectsCount; i++)
	{
		proj ++;
		Ptr&amp;lt;DataProject&amp;gt; proj = projects-&amp;gt;item(i);
                size_t foldersCount = proj-&amp;gt;rootFolder()-&amp;gt;dataFolders()-&amp;gt;count();
		for (size_t ii = 0; ii &amp;lt; foldersCount; ii++)
		{
			fol++;
		}
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 07:48:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10086154#M9399</guid>
      <dc:creator>goyals</dc:creator>
      <dc:date>2021-02-16T07:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Speed of browse DataPanel from API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10086608#M9400</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your quick reply. Although code by your advice runs half of the time, still is non-useable for me, because loading full active HUB with 10 projects, 50 folders, 84 files with the max level of project three is almost one minute and this is too long.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 12:18:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10086608#M9400</guid>
      <dc:creator>-pezi-</dc:creator>
      <dc:date>2021-02-16T12:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: Speed of browse DataPanel from API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10088947#M9401</link>
      <description>&lt;P&gt;Data API are inherently slow in nature because it make the REST API call to Fusion DM system to return the actual state of data when API is called. We are investigating how to improve these data API performance. Till then you can improve the performance to some extent by optimizing your code as I shown in my earlier reply. Thanks for posting your query.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 06:11:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10088947#M9401</guid>
      <dc:creator>goyals</dc:creator>
      <dc:date>2021-02-17T06:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Speed of browse DataPanel from API</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10101333#M9402</link>
      <description>Ok, thank's for your reply, I acceptation the actual state, and I hope you find a way to improve data API performance soon.</description>
      <pubDate>Mon, 22 Feb 2021 09:33:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/speed-of-browse-datapanel-from-api/m-p/10101333#M9402</guid>
      <dc:creator>-pezi-</dc:creator>
      <dc:date>2021-02-22T09:33:29Z</dc:date>
    </item>
  </channel>
</rss>

