Sign in to follow this  
Followers 0
UTA

Outlook object model gurus: Performance question

3 posts in this topic

#1 ·  Posted (edited)

Hi to everybody,

Attached is the relevant part - just to make it easier - of my source you need for this question.

Every five seconds it gets all the emails of a public (exchange) folder and inserts them into a listview. So perhaps it's also a kind of example how to do that (I saw a few questions about that during my research about the following problem).

My problem:

If you have a look into the heart of the _UpdateListView-Function you can see a For-Next-Loop which inserts all found items into the listview. After recognizing performance problems during this operation I searched for the reason and identified the following line:

_GUICtrlListView_AddSubItem ($SListView, $i-1, $Items.Item($i).SenderName, 1)

The whole loop as it is at the moment takes about 3 to 6 seconds to update.

[edit: time is related to the number of items in the folder. here: approx. 70]

During that time the whole GUI is freezed (because the source is working in the for-next-loop). Commenting the line above results in a significant performance-raise. Then it takes only 0.3 to 0.5 seconds.

The reason is the .SenderName-Object. BUT I DON'T KNOW WHY?

Does anybody of the COM-gurus here know why or perhaps a way to work around this performance-gap?

performance.au3

Edited by UTA

Share this post


Link to post
Share on other sites



@UTA

You can try to read the data to an ARRAY and then display the LISTVIEW

If it does not solve the issue, you can read in the data using ADO and then fill up the LISTVIEW.

Both ways will improve speed.

I made a speed improvement script for Excel

Read Excel using SQL

This might get you going.

regards

ptrex

Share this post


Link to post
Share on other sites

You can try to read the data to an ARRAY and then display the LISTVIEW

If it does not solve the issue, you can read in the data using ADO and then fill up the LISTVIEW.

Both ways will improve speed.

I made a speed improvement script for Excel

Read Excel using SQL

This might get you going.

I tried to read in 2-dim array and insert the array into the listview but it took longer than without it. I was sceptic before because the object itself seems the problem. Unfortunately my suspicion was correct, damn...

Average time:

  • using UDF-functions: 1863ms
  • using Built-in functions: 2249ms
  • using array with udf-functions: 2026ms

The other idea using ADO is to complex for me. :)

I had a look to your example but sorry, I am not able to port that to my needs... May I ask for an example ?

Otherwise any other ideas?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0