Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2004-03-13 16:49:06


Hi Jan,

The attached file corrects the mutex and fifo error in the first.

> It seems to me that if you use circular_buffer for
> storing "small" elements the circular_buffer is about
> 30% faster than deque. If you use larger elements the
> deque is faster about 10%.

> So, the result is: the circular_buffer is more
> effective for storing primitive types.

Could it be that your special treatment of small types makes this
difference?

I guess a deque cannot guarantee sequential data. Or could it with a special
allocator?

br

Thorsten

begin 666 cbuffer_vs_deque.cpp
M(V1E9FEN92!"3T]35%]$25-!0DQ%7T-"7T1%0E5'(#$-"@T*(VEN8VQU9&4@
M(F)O;W-T+V-I<F-U;&%R7V)U9F9E<BYH<' B#0HC:6YC;'5D92 \8F]O<W0O
M<')O9W)E<W,N:'!P/@T*(VEN8VQU9&4@/&)O;W-T+W1H<F5A9"]T:')E860N
M:'!P/@T*(VEN8VQU9&4@/&1E<75E/@T*(VEN8VQU9&4@/'-T<FEN9SX-"B-I
M;F-L=61E(#QI;W-T<F5A;3X-"@T*=7-I;F<@;F%M97-P86-E(&)O;W-T.PT*
M=7-I;F<@;F%M97-P86-E('-T9#L-"@T*;75T97@@<75E=65?;75T97@[#0IC
M;VYS="!I;G0@<75E=65?<VEZ92 @(" @/2 U,# [#0IC;VYS="!I;G0@=&]T
M86Q?96QE;65N=',@/2!Q=65U95]S:7IE("H@,3 P,# P.PT*#0IT96UP;&%T
M93P@='EP96YA;64_at_475E=64@/@T*:6YL:6YE(&)O;VP@:7-?9G5L;"@@8V]N
M<W0_at_475E=64F(&,@*0T*>PT*(" @(')E='5R;B!C+G-I>F4H*2 ]/2!Q=65U
M95]S:7IE.PT*?0T*#0IT96UP;&%T93P@='EP96YA;64_at_475E=64@/@T*8VQA
M<W,@<F5A9&5R#0I[#0H@(" @='EP961E9B!T>7!E;F%M92!1=65U93HZ=F%L
M=65?='EP92!4.PT*(" @(%%U975E)B @<3L-"B @(" -"G!U8FQI8SH-"B @
M("!R96%D97(H(%%U975E)B!Q("D_at_.B!Q*'$I('L@?0T*(" @( T*(" @('9O
M:60@;W!E<F%T;W(H*2_at_I#0H@(" @>PT*(" @(" @("!I;G0@<F5A9%]E;&5M
M96YT<R ](# [#0H@(" @(" @( T*(" @(" @("!W:&EL92@@<F5A9%]E;&5M
M96YT<R \('1O=&%L7V5L96UE;G1S("D@(" -"B @(" @(" @>PT*(" @(" @
M(" @(" @:68H("%Q+F5M<'1Y*"D@*2 @( T*(" @(" @(" @(" @>PT*(" @
M(" @(" @(" @(" @('L-"B @(" @(" @(" @(" @(" @(" @;75T97_at_Z.G-C
M;W!E9%]L;V-K(&QO8VLH('%U975E7VUU=&5X("D[#0H@(" @(" @(" @(" @
M(" @(" @(%0@=" ]('$N9G)O;G0H*3L-"B @(" @(" @(" @(" @(" @(" @
M<2YP;W!?9G)O;G0H*3L-"B @(" @(" @(" @(" @("!]#0H@(" @(" @(" @
M(" @(" @*RMR96%D7V5L96UE;G1S.PT*(" @(" @(" @(" @?0T*(" @(" @
M(" @(" @96QS90T*(" @(" @(" @(" @(" @(')E861?=&AR96%D*"DM/GEI
M96QD*"D[#0H@(" @(" @('T-"B @("!]#0H@(" @#0H@(" @<W1A=&EC('1H
M<F5A9"HF(')E861?=&AR96%D*"D-"B @("![#0H@(" @(" @('-T871I8R!T
M:')E860J('0@/2 P.PT*(" @(" @("!R971U<FX@=#L-"B @("!]#0I].PT*
M#0IT96UP;&%T93P@='EP96YA;64_at_475E=64@/@T*8VQA<W,@=W)I=&5R#0I[
M#0H@(" @='EP961E9B!T>7!E;F%M92!1=65U93HZ=F%L=65?='EP92!4.PT*
M(" @(%%U975E)B @<3L-"B @(" -"G!U8FQI8SH-"B @("!W<FET97(H(%%U
M975E)B!Q("D_at_.B!Q*'$I('L@?0T*(" @( T*(" @('9O:60@;W!E<F%T;W(H
M*2_at_I#0H@(" @>PT*(" @(" @("!I;G0@=W)I='1E;E]E;&5M96YT<R ](# [
M#0H@(" @(" @('=H:6QE*"!W<FET=&5N7V5L96UE;G1S(#P@=&]T86Q?96QE
M;65N=',@*0T*(" @(" @("![#0H@(" @(" @(" @("!I9B@@(6ES7V9U;&PH
M('$@*2 I#0H@(" @(" @(" @("![#0H@(" @(" @(" @(" @(" @>PT*(" @
M(" @(" @(" @(" @(" @("!M=71E>#HZ<V-O<&5D7VQO8VL@;&]C:R@@<75E
M=65?;75T97@@*3L-"B @(" @(" @(" @(" @(" @(" @<2YP=7-H7V)A8VLH
M(%0H*2 I.PT*(" @(" @(" @(" @(" @('T-"B @(" @(" @(" @(" @(" K
M*W=R:71T96Y?96QE;65N=',[#0H@(" @(" @(" @("!]#0H@(" @(" @(" @
M("!E;'-E(" @( T*(" @(" @(" @(" @(" @('=R:71E7W1H<F5A9"@I+3YY
M:65L9"@I.PT*(" @(" @("!]#0H@(" @?0T*(" @(" @(" -"B @("!S=&%T
M:6,@=&AR96%D*B8@=W)I=&5?=&AR96%D*"D-"B @("![#0H@(" @(" @('-T
M871I8R!T:')E860J('0@/2 P.PT*(" @(" @("!R971U<FX@=#L-"B @("!]
M#0I].PT*#0H-"G1E;7!L871E/"!T>7!E;F%M92!1=65U92 ^#0IV;VED(&9I
M9F]?=&5S="@I#0I[#0H@(" @<')O9W)E<W-?=&EM97(@=#L-"B @("!1=65U
M92 @<2@@<75E=65?<VEZ92 I.PT*(" @(')E861E<CQ1=65U93X@<F5A9&5R
M*"!Q("D[#0H@(" @=W)I=&5R/%%U975E/B!W<FET97(H('$@*3L@(" @#0H@
M(" @=&AR96%D(')E860H(')E861E<B I.PT*(" @('1H<F5A9"!W<FET92@@
M=W)I=&5R("D[#0H@(" @<F5A9&5R+G)E861?=&AR96%D*"D@/2 F<F5A9#L-
M"B @("!W<FET97(N=W)I=&5?=&AR96%D*"D@/2 F=W)I=&4[#0H@(" @(" @
M( T*(" @(')E860N:F]I;B_at_[hidden]*(" @('=R:71E+FIO:6XH*3L@(" @(" @
M(" @( T*#0I]#0H-"FEN="!M86EN*"D-"GL-"B @("!C;W5T(#P\(")<;B!C
M:7)C=6QA<E]B=69F97(\:6YT/CH@(CL-"B @("!F:69O7W1E<W0\(&-I<F-U
M;&%R7V)U9F9E<CQI;G0^(#XH*3L-"B @(" -"B @("!C;W5T(#P\(")<;B!D
M97%U93QI;G0^.B B.PT*(" @(&9I9F]?=&5S=#P_at_9&5Q=64\:6YT/B ^*"D[
M#0H-"B @("!C;W5T(#P\(")<;B!C:7)C=6QA<E]B=69F97(\<W1R:6YG/CH@
M(CL-"B @("!F:69O7W1E<W0\(&-I<F-U;&%R7V)U9F9E<CQS=')I;F<^(#XH
M*3L-"B @(" -"B @("!C;W5T(#P\(")<;B!D97%U93QS=')I;F<^.B B.PT*
M(" @(&9I9F]?=&5S=#P_at_9&5Q=64\<W1R:6YG/B ^*"D[#0H-"B @("!R971U
,<FX@,#L-"GT-"@T*
`
end


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk