Performance Improvements

 
 
By Jeff Hobbs  |  Posted 2010-09-16 Email Print this article Print
 
 
 
 
 
 
 


Performance improvements

The first thing some programmers do is commit premature optimization. That is, worrying about getting the tightest code but failing to optimize the way the database is used. Many times, the performance bottleneck is the database-so figure out how to optimize its performance before worrying whether you've got the very best algorithms.

Naturally, you're going to have a beefy database server but put it to good use. Don't hit the database server unless it's absolutely necessary. Cache results so that you're not making multiple (and unnecessary) calls for data you've already fetched once.

But you need to get the data, so how can you avoid it? A couple of ways: You can use an intermediate local data store to cache data between the main RDBMS and your application, such as memcached or Berkeley DB. Another tip is to avoid sprinkling unnecessary SQL queries throughout your code. Use object-relational mapping (ORM) to convert data between incompatible type systems. Perl's DBIx::Class module can speak with all kinds of traditional RDBMS to handle just about any type of work you're doing.

Summary

No matter what RDBMS you're using, it goes well with Perl. These aren't comprehensive guidelines but a good starting point to ensure that your application is going to be successful. Take the advice here and you'll be well on the way to a successful deployment or revision.

Jeff Hobbs is Director of Engineering at ActiveState, overseeing the development of all ActiveState products. He can be reached at jeffh@activestate.com.




 
 
 
 
Jeff Hobbs is Director of Engineering at ActiveState, overseeing the development of all ActiveState products. He can be reached at jeffh@activestate.com.
 
 
 
 
 
 
 

Submit a Comment

Loading Comments...

 
Manage your Newsletters: Login   Register My Newsletters























 
 
 
 
 
 
 
 
 
 
 
Rocket Fuel