StrataFrame Forum

Remote Subnet Application Speed

http://forum.strataframe.net/Topic27355.aspx

By Bill Cunnien - 6/9/2010

Good morning,



I am targeting the application startup to try to speed things up in our remote location. All databases are in location A. Location B is connected by a dedicated T1 (1.5Mbs) line. I have worked on many data queries to speed up certain windows within the application, now it is time to look at the startup. It takes 3-5 seconds for the application to open in location A. In location B, the app takes 30 seconds or more. What can I do...what can I look at...to increase the speed of the opening main window?



Thanks!

Bill
By Ivan George Borges - 6/9/2010

Hi Bill.

Have you considered using the Enterprise Server?

By Bill Cunnien - 6/9/2010

Sure. I am not in a position to make the investment. So, in light of that, what tips and tricks are there for getting an application to startup quickly. There does not seem to be a ton of DB activity initially. And, this slowdown occurs when all is quiet on the network.
By Greg McGuffey - 6/9/2010

Have you figured out what is taking the time? I.e. have you done any profiling? Once we know the answer to that question, then we could likely offer more focused suggestions.
By Bill Cunnien - 6/10/2010

I wish I knew what was taking the extra 30 seconds. I am stumped. What do you mean by "profiling"?



I have combed the code both in the program.cs and the initial form that fires up. I do not see anything that stands out. The only thing that I have left to me is to start whacking at the current code...remove all suspected intensive operations, then add them back in one at a time to see which is the culprit. I really do not want to do that because that would involve a lot of updates to currently published applications. It is currently impossible for me to test this application in a controlled environment (one that mimics the two subnets connected by a T1).



If there is anything that I could check in regard to the framework, please let me know. Perhaps a three second startup is to be expected. In light of that, a 30 second startup at the other end might be exactly right. Any insight into the startup plumbing would be appreciated.



Thanks.
By Ivan George Borges - 6/10/2010

Hi Bill.

Bill Cunnien (06/10/2010)
I wish I knew what was taking the extra 30 seconds. I am stumped. What do you mean by "profiling"?

Have a look at this:

http://www.red-gate.com/products/ants_performance_profiler/features.htm

By Bill Cunnien - 6/10/2010

Nice utility, but it doesn't look like it would work in a run-time environment at a remote location.



I'll just start whacking and hacking. Thanks, anyway.
By Edhy Rijo - 6/10/2010

Bill Cunnien (06/10/2010)
If there is anything that I could check in regard to the framework, please let me know. Perhaps a three second startup is to be expected. In light of that, a 30 second startup at the other end might be exactly right. Any insight into the startup plumbing would be appreciated.




Hi Bill,



Just to clarify, the programs are installed on each workstations, right?



If so, are you using SF security?



Are you using a main form? if so, does this make some sort of database connection or checking before finishing loading?
By Bill Cunnien - 6/10/2010

This is a winforms app and I am using RBS. The main form does have a few security checks going on (which is what I will whack and hack first), but I do not have any other DB activity. The security checks are used to determine what the user sees on the main form.
By Bill Cunnien - 6/10/2010

If a check for a specific permission is called like this...



cmdCoolButton.Enabled = (SecurityBasics.CurrentUser.GetPermission("Corporate").Action == PermissionAction.Grant);



...does the CurrentUser (ISecurity) object have it's permissions cached, or does the GetPermission run off to the server each time to perform a check?



It would be nice if they were cached locally. It would speed things up and limit the calls to the DB. The tradeoff is that a user would have to logoff then back on to obtain any new changes to the security profile. The tradeoff might be worth it.
By Edhy Rijo - 6/10/2010

I am not sure if the permissions are cached, my guess is that they are not.



Another idea is use a splash form which will do all the settings in the background letting the user know what is going on, then show up the main form when done. Trent posted a very easy to implement sample of such Splash Form in the forum a while ago, that sample project may give you some ideas to implement in your project.



Also using background process object in some key process speed up a lot of things, so if you have some sort of calculation process that you do before loading the main form, a background process can help you in that regard.



Please keep us posted.
By Ivan George Borges - 6/10/2010

From the help:

"When a user logs into the system, a flat list of his/her permissions is compiled according to the permissions assigned to the user through his/her assigned roles and directly assigned permissions."

If you have a look at the RBS source code, you will see that GetPermission will try to get the value from a Dictionary added with the user's permissions. This is initialized when the user is Authenticated. So, there won't be a trip to the server when GetPermission is used.

By Bill Cunnien - 6/10/2010

Thanks for looking that up...I tried going through the source code, but did not see that it was accessing a dictionary entry. That's good.
By Greg McGuffey - 6/10/2010

Bill,



Here's a good post from StackOverflow that might help out.



http://stackoverflow.com/questions/1489151/method-profiling-using-attributes
By Greg McGuffey - 6/10/2010

I just posted a sample profiler:



http://forum.strataframe.net/FindPost27390.aspx



The PostSharp looked very cool, but it was fun to geek out on this a bit. BigGrin