[sldev] Optimization via _set_sbh_threshold

Dirk Moerenhout blakar at gmail.com
Wed Jun 13 02:14:11 PDT 2007


Nick,

the small block heap is disabled as of win 2000 because of rewrites
that started in 1999.
See here: http://msdn2.microsoft.com/en-us/library/ms810466.aspx. It
supposedly doesn't work in 64-bit mode either (not a big issue in SL
for now).

The main reason not to revert to it is the fact that it has been
replaced by the Low Fragmentation Heap which works for larger blocks
too (upto 16K). This is available as of Windows 2000 (updated in 2003
and XP and backported algorithm to 2000 is available.). For SL the LFH
should have no issue doing a better job than the SBH.

I'm at work now and did a quick search thru the source and I don't
think the LFH is being enabled so I'll patch it up and see if it works
this evening.

Dirk aka Blakar Ogre

On 6/13/07, Nicholaz Beresford <nicholaz at blueflash.cc> wrote:
>
> Hi!
>
> I just added a
>
> _set_sbh_threshold(1016);
>
> near the top of WinMain and in one
> situation it was like WOHAA! in others
> I couldn't make out much difference.
>
> But if someone has test procedures or
> more experience with performance testing,
> it may be worth some efforts.
>
> I'll do a check tomorrow with counting
> allocs of various sizes (categories) to
> see if theory would back up usage of
> this function.
>
>
> Nick
>
>
>
> Second Life from the inside out:
> http://nicholaz-beresford.blogspot.com/
>
>
> Nicholaz Beresford wrote:
> >
> > Through a wild series of hops while researching
> > some crash dumps I stumbled over
> >
> > _set_sbh_threshold which seems to enable heap
> > routines optimzed for many small allocations
> > (just google for it).
> >
> > Did anyone ever try this so far?  Given what I
> > saw from my memory leak stuff, LL could be a nice
> > candidate for that.
> >
> >
> > Nick
> >
> >
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> /index.html
>


More information about the SLDev mailing list