Minor but fun changes today
mcn4 at leicester.ac.uk
Tue Feb 10 23:41:35 CET 2015
On Tue, Feb 10, 2015 at 05:05:23PM -0500, Alan DeKok wrote:
> After some discussion, I moved the REQUESTs to using a talloc
> pool. i.e. it allocates a 32K chunk of memory for reach
> request, and then allocates REQUEST, RADIUS_PACKET,
> VALUE_PAIR, etc. within that. If the pool runs out of memory,
> talloc() will fall back to using malloc. So there’s no
> downside to this. We’ve made a few other minor changes, too.
That makes sense - they're all hung off from each other anyway, so
it should make cleaning up much easier as you don't need to worry
about cleaning up each individual allocated block.
My first computer had 32k memory...
> But the changes today were ~600 LoC, for a 35% decrease in
> processing time. That’s not bad.
I thought talloc was generally slower (because of the management
overhead). I guess the efficiencies come from a single malloc,
rather than malloc/free all over the place when required. In my
experience, malloc can be painfully slow.
Matthew Newton, Ph.D. <mcn4 at le.ac.uk>
Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom
For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>
More information about the Freeradius-Devel