Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Pooling

Status
Not open for further replies.

week

MIS
Feb 14, 2001
118
0
0
US
I am trying to search on how we can use "Object Pooling" to improve performance. As I was reading various articles, I ran into one article says it can only be used in above VB 6.0 which would be like .NET. Is that right? Has anybody used it with VB 6.0?

Also, who knows anything about "Singleton Component"? I couldn't find anything on that with VB.

Thanks.

 
From what I'm reading, it's a pool manager on your application server that's responsible for object pooling. It's a runtime issue; VB6 neither supports nor fails to support it.

On topic: MTS v2.0 (NT4 vintage) does not support object pooling.

So, it looks like your search is still alive.

What do you hope to gain? Do you have a lot of server objects that are heavy on initialization code or what?
 
I have an object that will parse a XML file. This will be used over and over again by many different client from this application.

In my class I am parsing the XML through DOM and it's looking good so far but not sure how it would perform as the size of the XML file grows. I am in the middle of testing that now...

So, while my test runs I am trying to research on possible solutions if the larger file becomes a bottle neck..
 
I could be wrong, but investigating object pooling sounds to me like you're barking up the wrong tree.
 
Actually, it's looking more like it as I research more on OP...
 
Object pooling is only possible with free or both threaded object. Since VB does not support this (until .NET) you can't utilise object pooling....that said object pooling is a very specialised situation and only notice a benifit if the object in question have large amounts of initializing to do. With VB object its often more efficient to just destroy them and recreate them when needed.
 
Thanks everyone for your input. I am using DOM object for parsing XML and it seems to be doing what I want to accomplish.

But still, SemperFiDownUnda, are you familiar with Singleton Component? Have you seen one done in VB?
 
If you're working on design patterns in VB, you ought to get a copy of "MS VB Design Patterns" by William Stamatakis from MS Press. It describes the Singleton and nine other patterns.

The big clue you'll find there to the Singleton is:
Based on the current constraints of the Visual Basic [VB6] language, using an Object Factory design pattern to implement a Singleton design pattern has proven to be the most suitable approach.

 
A singleton component is like a stateful component which I'm not a fan of in many cases. On the client side this isn't that a problem with scaleablity.

I would say lets step back and ask what are you trying to achieve here? It your object taking to long to initialise?
 
We are testing to see if it would be any problem replacing input file being from a binary file to an XML file. When I first started this thread, I had very little knowledge what it would do. I had to be flexible as to what the next step would be.

Since I first started this thread, I now discovered most of the time difference dealing with binary file and XML file is coming from loading XML file which is still not bad but it would be nice if we can find something that can help speed up the loading. This XML file wouldn't get too big. Current file size is about 1.6MB which takes about 0.90 sec to load.

So, that's my objective for now....

Let me know if you have any suggestions. Thanks.
 
You should look into caching that file for the whole host. .9 seconds is what I would concider long especially if you have a situation where 20+ people activate that object at the same time.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top