Normal Topic Speed Optimization Help (Read 599 times)
dhopkins
Member
*
Offline



Posts: 47
Joined: Aug 20th, 2007
Speed Optimization Help
Nov 13th, 2007 at 4:30pm
Print Post Print Post  
Hi,
I'm at the final stages of developing a Sesame2 app and now it's time to look at optimization. At this point, the app has a couple hundred items that get calculated which equates to over 1000 fields that it works with.  And its slow. I've managed to use what i've learned in other programming languages to speed it up quite a quite but there are still times when you move to a field you have to wait 3-4 seconds for Sesame to update.

I've switched  a large number of variables to global static variables. That helped a lot.
I was thinking about switching the OnFormChange events to separate on OnElementChange events. But that would mean moving from a dozen of so events to a few hundred. And I dont think that'd make it faster.

What I'm asking is, is there a list of techniques or tricks to optimize and speed up sbasic programs? Like which commands can be substituted out for faster ones. Which variable types or comparisions slow down processing (for example, comparing intergers or strings). that sort of stuff.

Thanks,
D
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Speed Optimization Help
Reply #1 - Nov 13th, 2007 at 4:42pm
Print Post Print Post  
dhopkins wrote on Nov 13th, 2007 at 4:30pm:
What I'm asking is, is there a list of techniques or tricks to optimize and speed up sbasic programs? Like which commands can be substituted out for faster ones. Which variable types or comparisions slow down processing (for example, comparing intergers or strings). that sort of stuff. 


Yes. It's a long list and some of the items on it are very specific. I'll throw out some of the basics:
1. Variables are faster than elements.
2. Ints and Doubles are faster than Strings
3. Don't do anything more than once.
4. #3 especially applies to X commands.
5. If you are doing multiple XLookups to the same record, use @XLookupSourceList instead.
6. If you are using @XLookupR, use XResultSet instead.
7. If you are using XPost, use XResultSet instead.
8. Split is faster than @AccessStringArray.
9. Write less code.
10. Don't run your code more often that necessary. Use the proper events and conditional checks.

It's difficult to offer further advice without seeing what is slowing you down. Code optimization is all about the specifics.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
dhopkins
Member
*
Offline



Posts: 47
Joined: Aug 20th, 2007
Re: Speed Optimization Help
Reply #2 - Nov 13th, 2007 at 5:30pm
Print Post Print Post  
Thanks! The Split vs AccessStringArray made a huge difference all by itself.

D
  
Back to top
 
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Speed Optimization Help
Reply #3 - Nov 14th, 2007 at 4:15am
Print Post Print Post  
Here are two more suggestions:

11.  It may vary among applications, but Natural links are usually much faster than Relational links.
12.  Use Server/Client vs. standalones working with a server computer
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged