Vector vs std::vector

From: Kinkie <gkinkie_at_gmail.com>
Date: Wed, 29 Jan 2014 15:08:20 +0100

Hi,
   Amos has asked me over IRC to investigate any performance
differences between Vector and std::vector. To do that, I've
implemented astd::vector-based implementation of Vector
(feature-branch: lp:~squid/squid/vector-to-stdvector).

I've then done the performance testing using ab. The results are in: a
Vector-based squid is about 3% speedier than a std::vector based
squid.
This may also be due to some egregious layering by users of Vector. I
have seen things which I would like to correct, also with the
objective of having Vector implement the same exact API as std::vector
to make future porting easier.

test conditions:
- done on rs-ubuntu-saucy-perf (4-core VM, 4 Gb RAM)
- testing with ab. 1m requests @10 parallelism with keepalive,
stressing the TCP_MEM_HIT code path on a cold cache
- test on a multicore VM; default out-of-the-box configuration, ab
running on same hardware over the loopback interface.
- immediately after ab exits, collect counters (mgr:counters)

numbers (for trunk / stdvector)
- mean response time: 1.032/1.060ms
- req/sec: 9685/9430
- cpu_time: 102.878167/106.013725

-- 
    /kinkie
Received on Wed Jan 29 2014 - 14:08:29 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 29 2014 - 12:00:14 MST