[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: typedef void * (*lua_Alloc) caching
- From: C++ RTMP Server <crtmpserver@...>
- Date: Sun, 3 Apr 2011 21:37:51 +0300
Table 7: Real Scenario Test
new/delete static_mem_pool (default) static_mem_pool (thread-specific)
Linux GCC 3.2.21 5.87 0.84 0.83
Linux GCC 3.4.21 5.91 2.61 0.77
Linux GCC 3.2.22 12.82 8.77 0.84
Linux GCC 3.4.22 12.73 8.45 0.76
http://wyw.dcweb.cn/static_mem_pool.htm
The improvements are quite significant. Especially in single-threaded envs.
On Apr 3, 2011, at 9:31 PM, Luiz Henrique de Figueiredo wrote:
>> Is it worth implementing a nice caching mechanism for doing allocations inside lua_Alloc function?
>
> I think the accepted wisdom is to avoid trying to outsmart malloc.
>
>> I've done some synthetic tests, and it looks like there is a lot of improvements especially when working with android on a phone.
>
> Perhaps use a better malloc from the start then?
>
------
Eugen-Andrei Gavriloaie
Web: http://www.rtmpd.com