New Posts New Posts RSS Feed: Performance Question
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Performance Question

 Post Reply Post Reply Page  <12
Author
skingaby View Drop Down
DevForce MVP
DevForce MVP
Avatar

Joined: 23-Apr-2008
Location: United States
Posts: 146
Post Options Post Options   Quote skingaby Quote  Post ReplyReply Direct Link To This Post Topic: Performance Question
    Posted: 28-Sep-2009 at 4:21pm
I've set up an AsyncParallelTask that runs 18 different entity queries to get all of the entities necessary for our grid form to be populated and editable. The main entity has a ton of foreign keys, types, statuses, children, etc, so there are a lot of queries to run.   We tried a giant entity query that used .Include() to pull in all the foreign keys but that query took FOREVER to run. So, I split it up and am running each query independently as an AsyncQuery task in an AsyncParallelTask. Most of the queries are short tables of 3-5 rows and a handful of columns, with a couple of them having 200-300 rows and 20 or so columns. None are large tables with thousands of rows. None have BLOB data in them. The database is Oracle, using the DevArt dotConnect drivers. I am using pre-compiled views in the ModelEF project.
The entire set takes just under 1 minute to run.
First, I broke the 18 queries down and ran each one separately. I.e. One query task for each run.
Then I added back each query one at a time to see what effect each additional query has on the total time. Times are in milliseconds. The logging is all client side and is displayed in a client-side log window as described elsewhere in this forum. The timer starts immediately prior to creating the AsyncParallelTask as in this snippet:

private void InitializeCache()
{
    Logging.TimerStart();
    task = AsyncParallelTask.Create();
    ...
    task.AddAsyncQuery(queryName, x => query, querySpecificCallback);
    ...
    task.Execute(InitializationCallback);
}
private void InitializationCallback(AsyncParallelTaskCompletedArgs args)
{
    Logging.TimerStop();
}

Timings:
1            - 9038.7200
2            - 8805.6945
3            - 8977.1328
4            - 9413.8232
5            - 9569.6812
6            - 9008.5924
7            - 9928.1546
8            - 9382.6516
9            - 9304.7823
10           - 9522.9849
11           - 9819.1170
12           - 9024.2361
13           - 9694.4298
14           - 9351.5400
15           - 10099.7280
16           - 9741.2500
17           - 10582.8940
18           - 10333.8556

1            - 9985.7012, 9810.7346
1+2          - 10998.5140
1+2+3        - 13736.2736
1 to 4       - 15233.2812
1-5          - 19135.6341
1-6          - 20859.5651
1-7          - 24581.1580
1-8          - 26080.3900
1-9          - 30593.7030
1-10        - 32208.2180
1-11        - 35689.7266
1-12        - 40383.2564, 36399.0270, 38258.0331,
1-13        - 41418.6368
1-14        - 45418.3866
1-15        - 47433.8568
1-16        - 48622.9544
1-17        - 55391.4640
1-18        - 58385.8935, 56948.4435

So, my question is:
What is each query doing that is taking 10 seconds? What are the queries doing that increment the total time by 3-4 seconds? Is there anything I can do to optimize this code / these queries / the EF loading times / the Entity construction time? Etc. Do you have any tips about enabling/disabling things at run time that can speed it up, for example, disabling the PropertyInterceptors on classes until AFTER the Async load has happened?
Thanks,
Simon
Back to Top
 Post Reply Post Reply Page  <12

Forum Jump Forum Permissions View Drop Down