PersistenceInfoFactory's GetBucket method

Posts   
 
    
Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 26-Mar-2006 15:12:50   

Frans,

Why the cache is not enable by default? What are the cons if I enable it in a remoting scenario (multiple user)?

Does the FetchEntity creates PersitenceInfo object?

Does the SaveEntityCollection implements some kind of cache for the PersistenceInfo object that it need to create?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39930
Joined: 17-Aug-2003
# Posted on: 27-Mar-2006 12:04:08   

Rogelio wrote:

Frans,

Why the cache is not enable by default? What are the cons if I enable it in a remoting scenario (multiple user)?

It's thread safe, though does that with a lock, so it can be a little slower (can, doesn't have to). It's not enabled by default because it eats memory simple_smile

Does the FetchEntity creates PersitenceInfo object?

yes, every query created creates the buckets.

Does the SaveEntityCollection implements some kind of cache for the PersistenceInfo object that it need to create?

No, it's created every time. As the bucket is just very small, not a lot of cycles are spend there, compared to the cycles spend on the roundtrip to the db.

In v2, this changes though: every field in an entity has a static part and a dynamic part. The static part is shared among all instances of that field: name, type etc. The value of the field is dynamic. Persistence info is also shared among all fields, so no more factories to produce it, it's cached in a readonly cache at startup, so it's much faster to create entities and save entities and also entities have a much much lower memory footprint.

Frans Bouma | Lead developer LLBLGen Pro
Rogelio
User
Posts: 221
Joined: 29-Mar-2005
# Posted on: 27-Mar-2006 12:14:29   

Otis wrote:

In v2, this changes though: every field in an entity has a static part and a dynamic part. The static part is shared among all instances of that field: name, type etc. The value of the field is dynamic. Persistence info is also shared among all fields, so no more factories to produce it, it's cached in a readonly cache at startup, so it's much faster to create entities and save entities and also entities have a much much lower memory footprint.

Wonderful, I want v2 as soon as it get out.