[sldev] Optimization via _set_sbh_threshold

Nicholaz Beresford nicholaz at blueflash.cc
Wed Jun 13 04:34:23 PDT 2007

> note that only the second option on that page for activating LFH is
> correct. The first one just sets up a SBH with a limit at 128 bytes.
> While LFH uses 128 buckets that's not the same as being limited at 128
> bytes.

Yes, I think I understand that part.  As I mentioned in the count,
66% of the allocations in SL were 32 bytes or less and even the
small example of sbh with (128) would catch 83%.  My own test was
with the sbh(1016) example that seems to have been the default
in VC6.

Out of 3 Million allocs:
2 Million were less than 32 bytes and less
2.5 Million were less than 128 bytes
2.9 Million were less than 1024 bytes

So mileage may differ between sbh and LFH ... SBH seems to have
the benefit of being able to just catch the small stuff and let
the bigger ones proceed as before (going to the normal heap).

But I guess LBH sounds more promising in the long term.


More information about the SLDev mailing list