PBDR.COM

About   -   Contact   -   Purchase   -   Search   -   What's New

 
 
Local/Instance Datastores and Bind
When building server side components in PowerBuilder we all build our components as stateless right! This means we can choose to build our components with local datastores or instance datastores. If we have instance datastores we need to check the bind checkbox on the final tab of the deployment options dialog, if we create all our datastores locally we can uncheck this box. What does all this mean in terms of performance?
  1. If you are using primarily static data which will not change for the life time of your object, it is quicker to create instance datastores, load the data on the first use and then keep it around serving the same data each time. You will need bind switched on. The amount of performance lost from disable bind will be negated by not having to hit the database on each call.
  2. If you are using no cached data then it is quicker to create and destroy your datastores on each function call, not having instance datastores will allow you to uncheck the bind option. Although not a massive performance increase it will make your application more scalable and save around 5% of performance (see below for my test results).

I ran a series of tests making calls to server side objects with both the local and instance datastores, pulling back 3 result sets ( 10, 20, 50 rows respectively ) in a single stateless function call. On average the stateless option with instance datastores with the create in the constructor/destructor versus creating and destroying them in the function was around 4 - 5% slower.

While this is not a hard and fast rule as there is an obvious gray area in the middle when you only have some cached data. I suggest you build your own test harness and the frequently accessed objects and tune them to see which suits best. 

 

Top of Page

Legal Notice

Ken Howe 2011