Forum OpenACS Development: Re: util_memoize performance

Collapse
Posted by Tom Jackson on
Yes, thanks for the benchmark: everything has to get into memory at some point, the savings is in getting it from current memory, and not bogging down your database which also has to put it into memory, etc. (But even your database will cache certain rows, so it isn't always going to disk.)

This is the difference between 'storage' and 'memory'. Storage is dead storage, on disk, far away. Memory is ready to go. One difference with util_memoize and TLS is the slight overhead for the mutex. But AOLserver uses mutex buckets, so you benefit from a low number of mutexes to maintain even for a lot of somewhat independent nsv arrays. However, if everything is in one array, this could lead to slowness. (I think this is right? I don't think nsv buckets divide arrays, but they might.)