Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #11239

Re: Fast Container

From Thomas Lehmann <thomas.lehmann.private@googlemail.com>
Newsgroups comp.lang.c++
Subject Re: Fast Container
Date 2011-11-03 07:12 -0700
Organization http://groups.google.com
Message-ID <26298978.69.1320329565410.JavaMail.geo-discussion-forums@yqan20> (permalink)
References <11641689.1682.1320247319417.JavaMail.geo-discussion-forums@vbay19> <icadnWM0G-63-CzTnZ2dnUVZ7oednZ2d@giganews.com>

Show all headers | View raw


Maybe I'm doing something wrong but comparing to vector
and deque your segmented_array is not faster.

- I'm compiling on Windows Ultimate 64 Bit
- I've tried with 64 and 1024 segments.
- 200000 elements (with push_back)
- took 5ms (vector took 2ms, deque took 5ms)
- The code looks same for deque and vector:

<code>
BOOST_AUTO_TEST_CASE(SegmentedArrayAddValues)
{
	const unsigned int limit = 200000;

	SegmentedArrayTest<int>* container = new SegmentedArrayTest<int>();
	container->createContainer();

	// creating content
	for (unsigned int ix = 0; ix < limit; ++ix)
		container->addValue(ix);

	BOOST_CHECK_EQUAL(container->size(), (size_t)limit);

	// cleanup
	delete container;
}
</code>

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Fast Container Thomas Lehmann <thomas.lehmann.private@googlemail.com> - 2011-11-02 08:21 -0700
  Re: Fast Container Leigh Johnston <leigh@i42.co.uk> - 2011-11-02 15:43 +0000
    Re: Fast Container jacob navia <jacob@spamsink.net> - 2011-11-02 18:09 +0100
      Re: Fast Container Leigh Johnston <leigh@i42.co.uk> - 2011-11-02 17:24 +0000
    Re: Fast Container Thomas Lehmann <thomas.lehmann.private@googlemail.com> - 2011-11-03 07:12 -0700
      Re: Fast Container Leigh Johnston <leigh@i42.co.uk> - 2011-11-03 14:37 +0000
  Re: Fast Container Victor Bazarov <v.bazarov@comcast.invalid> - 2011-11-02 12:40 -0400
    Re: Fast Container Leigh Johnston <leigh@i42.co.uk> - 2011-11-02 16:56 +0000
    Re: Fast Container Thomas Lehmann <thomas.lehmann.private@googlemail.com> - 2011-11-03 07:01 -0700
      Re: Fast Container Victor Bazarov <v.bazarov@comcast.invalid> - 2011-11-03 10:13 -0400
  Re: Fast Container Werner <werasm@gmail.com> - 2011-11-02 14:06 -0700
    Re: Fast Container Werner <werasm@gmail.com> - 2011-11-02 14:11 -0700
  Re: Fast Container Nick Keighley <nick_keighley_nospam@hotmail.com> - 2011-11-03 08:45 -0700

csiph-web