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
Currently we segregate freelists by the class of the object. One for compact ints, one for floats, one for lists, etc.
This means we have many more freelists than we need for the number of different sizes of objects that we store in freelists.
Using a freelist based on the size of the object would increase sharing, but might add overhead as we would need to store the class of the object as well as the refcount when getting the memory from the freelist.
Even with the extra memory write, the improved cache use might make it faster.
We would only need one write if we were to thread the freelist through the ob_type field instead of the ob_refcnt field, keeping the ref count set to 1.
Instead of:
if (--obj->ob_refcnt==0) {
put_in_freelist(obj);
}
We would have:
if (obj->ob_refcnt==1) {
put_in_freelist(obj);
}
--obj->ob_refcnt;
leaving the refcount as 1 in the freelist.
Let's try out the simpler size based version first, to see if it is faster. We can try preserving the refcount later.
The text was updated successfully, but these errors were encountered:
Currently we segregate freelists by the class of the object. One for compact
int
s, one forfloat
s, one forlist
s, etc.This means we have many more freelists than we need for the number of different sizes of objects that we store in freelists.
Using a freelist based on the size of the object would increase sharing, but might add overhead as we would need to store the class of the object as well as the refcount when getting the memory from the freelist.
Even with the extra memory write, the improved cache use might make it faster.
We would only need one write if we were to thread the freelist through the
ob_type
field instead of theob_refcnt
field, keeping the ref count set to 1.Instead of:
We would have:
leaving the refcount as 1 in the freelist.
Let's try out the simpler size based version first, to see if it is faster. We can try preserving the refcount later.
The text was updated successfully, but these errors were encountered: