You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/*
* XXX: memory and lookup performance could possibly be improved by
* storing all keys in one allocation.
*/
That seems like a good idea. We'd like to reduce backend memory usage. This is a very small part of it, but it's also a very localized change.
Also, this function often deals with the 'name' type. 'name' is a fixed-width type, 64 bytes wide (NAMEDATALEN to be precise). However, it's always null-terminated, and the functions in catcache.c like nameeqfast and namehashfast treat it as a C string. So we don't really need to alloc and copy the whole 64 bytes, we could call strlen() here and leave out the trailing zeros.
Tasks:
Create a test case that shows the benefit. Something that creates a lot of catcache entries, and measure the memory usage.
Do the above optimizations
The text was updated successfully, but these errors were encountered:
I believe I have the optimization for the string case done. Being unfamiliar with this portion of code, I don't necessarily understand how best to test it.
CatCacheCopyKeys has this:
That seems like a good idea. We'd like to reduce backend memory usage. This is a very small part of it, but it's also a very localized change.
Also, this function often deals with the 'name' type. 'name' is a fixed-width type, 64 bytes wide (NAMEDATALEN to be precise). However, it's always null-terminated, and the functions in catcache.c like nameeqfast and namehashfast treat it as a C string. So we don't really need to alloc and copy the whole 64 bytes, we could call strlen() here and leave out the trailing zeros.
Tasks:
The text was updated successfully, but these errors were encountered: