RTD performance problem

Add-in Express™ Support Service
That's what is more important than anything else

RTD performance problem
 
Kiru Marimuthu


Guest


Hi

We got a workbook with 56,745 topics in it. When we try to open the workbook through File => Open menu, it takes nearly 4 minutes to open the workbook every time. We could see each topics call Connect event in the ADXRTDServerModule.
Using Redgate Ants profiler we can see most of the time(nearly 63%) been spent in AddinExpress.RTD.ADXRTDServerModule.IndexOfTopicStrings inside Addin Express source code.

Please refer the screenshot from the profiler.
[img]https://ibb.co/gBiYpo[/img]


Going through the addin express forum we can see someone faced the similar issue.
https://www.add-in-express.com/forum/read.php?FID=5&TID=2293.

Is there any optimization done as per forum answer there?

We are using Addin Express version 8.8.4450 and the test was done in Excel 2016(32 bit). We have the premium subscription and we note that we can request features or fixes. Can we talk to someone further?

Thanks
Kiru
Posted 26 Jun, 2018 09:29:03 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello Kiru,

That topic is too old. As far as I know, we think no further optimization is possible with so many topics. Still, I'll find as many details possible and return to you tomorrow.


Andrei Smolin
Add-in Express Team Leader
Posted 26 Jun, 2018 09:52:19 Top
Gavin Howard




Posts: 14
Joined: 2016-12-01
Andrei - yes please have a look into this for us and escalate to the core developers if possible.

Currently a Topic for us is a single Excel cell. Is this the right approach? We have built a financial services addin and have built our own API which provides the data back to each excel cell. There will be times when users will want data of this size - so its important to our use case.
Posted 26 Jun, 2018 10:52:07 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello Gavin and Kiru,

Topic is a set of strings that you pass to the RTD function:

= RTD("MyRtdServer.ProgId",,string1, string2, ...., string28)

To get 55000 topics, you pass 55000 different string combinations to the RTD function.

Kiru Marimuthu writes:
Using Redgate Ants profiler we can see most of the time(nearly 63%) been spent in AddinExpress.RTD.ADXRTDServerModule.IndexOfTopicStrings inside Addin Express source code.


The goal of the topic component is to fire events for you. To map a combination of strings that the RTD function receives to a topic component, you have to search that combination of strings among existing topic components. In other words, each topic component is identified by the set of strings. As you've found searching the component consumes a lot of time. If you look into the code you'll find that we've already optimized our code to a certain degree. We don't expect any radical changes if we use a different algorithm.

With the existing algorithm, the most time-consuming scenario is having 55000 topics *all* having the same number of parameter strings and the strings are unique. Consider e.g. having 55000 topics all having a single parameter having 55000 unique values. To speed up the search in this situation, you need to have less topics. Another approach is to group topics in several (many) categories so that a topic has two (or more) parameters: the first parameter (and the remaining parameters except for the last one) contain strings that identify the group; the last parameter identifies the topic (within this group). In this case, the algorithm will switch to looking in another topic when it finds that the first parameter is different.

Introducing a number of such categories and having a different number of them will also speed up the things with the current algorithm as it compares the number of parameters first.

In the case you must have 55000 topics each having the same number of parameters there's yet another variant. You can create a custom solution that excludes searching: it concatenates the parameter strings and use the resulting string as an index. Add-in Express doesn't do so to prevent this scenario: you have two topics: Topic1 {string01="*"} and Topic2 {string01="*" string02="*"} and you have two RTD calls passing these strings to the RTD functions: 1) "hello", 2) "hell", "o".


Andrei Smolin
Add-in Express Team Leader
Posted 27 Jun, 2018 06:29:56 Top
Kiru Marimuthu


Guest


Hi Andrei

We have changed AddinExpress code and seen an improvement in performance. Could you please review the code?
We will send it to the support email address.

Thanks
Kiru
Posted 28 Jun, 2018 10:40:27 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello Kiru,

Thank you. We've received your email and now we are looking into the code.


Andrei Smolin
Add-in Express Team Leader
Posted 29 Jun, 2018 02:56:56 Top