Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: C++ Memory ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 26 of 41 Topic 9525 of 9830
Post > Topic >>

Re: C++ Memory Management Innovation: GC Allocator

by xushiwei <xushiweizh@[EMAIL PROTECTED] > Apr 25, 2008 at 10:45 AM

On Apr 24, 3:43 pm, "Chris Thomasson" <cris...@[EMAIL PROTECTED]
> wrote:
>
> There are benefits for using TLS. Think of a simple contrived scenario
like:
>
> void function() {
>  // I need to allocate from m_alloc...
>  // How can I do this without adding any parameters?
>
> }
>
> void thread() {
>  GenericAllocator m_alloc;
>  function();
>
> }
>
> AFAICT, your allocator can use TLS as-is... Basically, something like:
>
> void function() {
>  GenericAllocator* const pm_alloc = pthread_getspecific(...);
>  // Now I can allocate from m_alloc! :^D
>
> }
>
> void thread() {
>  GenericAllocator m_alloc;
>  pthread_setspecific(..., &m_alloc);
>  function();
>
> }
>
> Don't you think that your design could "possibly" benefit from using
TLS?
> IMVHO, it would increase its flexibility...
>

I'm happy to say that performance of TlsScopeAlloc is close to
ScopeAlloc. Here is one of my result:

===== AutoFreeAlloc(1) =====
Average: ---> Elapse 71284646 ticks (71.28 ms) (0.00 min) ...

===== APR Pools(1) =====
Average: ---> Elapse 77065368 ticks (77.07 ms) (0.00 min) ...

===== TlsScopeAlloc(1) =====
Average: ---> Elapse 21068489 ticks (21.07 ms) (0.00 min) ...

===== ScopeAlloc(1) =====
Average: ---> Elapse 14929159 ticks (14.93 ms) (0.00 min) ...

===== MtAllocator(1) =====
Average: ---> Elapse 65385419 ticks (65.39 ms) (0.00 min) ...

===== DLMalloc(1) =====
Average: ---> Elapse 181303561 ticks (181.30 ms) (0.00 min) ...

===== BoostPool(1) =====
Average: ---> Elapse 264567223 ticks (264.57 ms) (0.00 min) ...

===== BoostObjectPool(1) =====
Average: ---> Elapse 397389191 ticks (397.39 ms) (0.01 min) ...

===== NewDelete(1) =====
Average: ---> Elapse 59987942 ticks (59.99 ms) (0.00 min) ...

===== AutoFreeAlloc(1000) =====
Average: ---> Elapse 1134564 ticks (1.13 ms) (0.00 min) ...

===== APR Pools(1000) =====
Average: ---> Elapse 8465549 ticks (8.47 ms) (0.00 min) ...

===== TlsScopeAlloc(1000) =====
Average: ---> Elapse 2119220 ticks (2.12 ms) (0.00 min) ...

===== ScopeAlloc(1000) =====
Average: ---> Elapse 2117445 ticks (2.12 ms) (0.00 min) ...

===== MtAllocator(1000) =====
Average: ---> Elapse 70740550 ticks (70.74 ms) (0.00 min) ...

===== DLMalloc(1000) =====
Average: ---> Elapse 207583238 ticks (207.58 ms) (0.00 min) ...

===== BoostPool(1000) =====
Average: ---> Elapse 7135785 ticks (7.14 ms) (0.00 min) ...

===== BoostObjectPool(1000) =====
Average: ---> Elapse 10780571 ticks (10.78 ms) (0.00 min) ...

===== NewDelete(1000) =====
Average: ---> Elapse 63238984 ticks (63.24 ms) (0.00 min) ...

===== AutoFreeAlloc(1000000) =====
Average: ---> Elapse 2631304 ticks (2.63 ms) (0.00 min) ...

===== APR Pools(1000000) =====
Average: ---> Elapse 8787553 ticks (8.79 ms) (0.00 min) ...

===== TlsScopeAlloc(1000000) =====
Average: ---> Elapse 2193191 ticks (2.19 ms) (0.00 min) ...

===== ScopeAlloc(1000000) =====
Average: ---> Elapse 2149852 ticks (2.15 ms) (0.00 min) ...

===== MtAllocator(1000000) =====
Average: ---> Elapse 89697667 ticks (89.70 ms) (0.00 min) ...

===== DLMalloc(1000000) =====
Average: ---> Elapse 258619410 ticks (258.62 ms) (0.00 min) ...

===== BoostPool(1000000) =====
Average: ---> Elapse 9320836 ticks (9.32 ms) (0.00 min) ...

===== BoostObjectPool(1000000) =====
Average: ---> Elapse 12252103 ticks (12.25 ms) (0.00 min) ...

===== NewDelete(1000000) =====

Average: ---> Elapse 125101384 ticks (125.10 ms) (0.00 min) ...

-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 41 Posts in Topic:
[Proposal for ISO C/C++] C++ Memory Management Innovation: GC A
xushiwei <xushiweizh@[  2008-04-21 12:13:18 
Re: [Proposal for ISO C/C++] C++ Memory Management Innovation: G
"Chris Thomasson&quo  2008-04-21 15:39:15 
Re: [Proposal for ISO C/C++] C++ Memory Management Innovation: G
"Chris Thomasson&quo  2008-04-21 16:13:16 
Re: [Proposal for ISO C/C++] C++ Memory Management Innovation: G
Alberto Ganesh Barbati &l  2008-04-21 20:43:17 
Re: C++ Memory Management Innovation: GC Allocator
marlow.andrew@[EMAIL PROT  2008-04-21 20:43:18 
Re: C++ Memory Management Innovation: GC Allocator
Lance Diduck <lancedid  2008-04-21 20:43:17 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 00:08:55 
Re: [Proposal for ISO C/C++] C++ Memory Management Innovation: G
"Chris Thomasson&quo  2008-04-22 10:52:14 
Re: C++ Memory Management Innovation: GC Allocator
Lance Diduck <lancedid  2008-04-22 11:17:48 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 11:17:25 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 11:13:27 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 15:19:26 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 15:19:18 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 15:22:50 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 15:43:17 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 22:26:21 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-22 22:25:42 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-22 22:32:36 
Re: C++ Memory Management Innovation: GC Allocator
Francis Glassborow <fr  2008-04-23 14:13:19 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-23 14:43:18 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-24 01:43:35 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-25 03:42:49 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-25 10:47:43 
Re: C++ Memory Management Innovation: GC Allocator
"Stephen Howe"   2008-04-25 10:48:18 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-25 10:47:13 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-25 10:45:25 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-25 10:44:50 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-25 16:15:02 
Re: C++ Memory Management Innovation: GC Allocator
Yongwei Wu <wuyongwei@  2008-04-28 15:58:48 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-28 23:26:31 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-28 23:27:55 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-29 17:43:31 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-30 04:13:27 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-30 04:13:33 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-04-30 17:03:54 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-04-30 21:55:29 
Re: C++ Memory Management Innovation: GC Allocator
Michael Kilburn <crusa  2008-05-06 08:22:59 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-05-06 08:20:19 
Re: C++ Memory Management Innovation: GC Allocator
"Chris Thomasson&quo  2008-05-07 00:31:29 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-05-07 11:03:52 
Re: C++ Memory Management Innovation: GC Allocator
xushiwei <xushiweizh@[  2008-05-08 03:28:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:48:31 CDT 2008.