Den 13-10-2017 kl. 19:45 skrev Benedek Thaler via Boost:
(It'd be great if someone could re-run these tests to verify my results)
I gave it a try. My compile options are
/GS- /GL /analyze- /W3 /Gy /Zc:wchar_t
/I"C:\dezide_cpp_projects\CDependencies\include" /Zi /Gm- /O2 /Ob2
/Fd"Release\vc141.pdb" /Zc:inline /fp:precise /D "WIN32" /D "NDEBUG" /D
"_CONSOLE" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX-
/Zc:forScope /arch:SSE2 /Gd /Oy- /Oi /MD /Fa"Release\" /EHsc /nologo
/Fo"Release\" /FAs /Ot /Fp"Release\TestDoubleEnded.pch"
/diagnostics:classic
/D _SECURE_SCL=0 /D _CRT_SECURE_NO_DEPRECATE=1 /D
_SCL_SECURE_NO_DEPRECATE=1 /D _CRT_NONSTDC_NO_DEPRECATE=1 /D
BOOST_DISABLE_ASSERTS /Qpar /DHAVE_STD_REGEX
32 bit:
Run on (8 X 3492 MHz CPU s)
10/13/17 20:12:05
-------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------
devector_insert/8 3266 ns 3105 ns 236166
devector_insert/64 26578 ns 28473 ns 34517
devector_insert/512 227531 ns 255922 ns 2804
devector_insert/4096 2505054 ns 2836382 ns 374
devector_insert/32768 68911138 ns 74880480 ns 10
devector_insert/65536 259531320 ns 254801633 ns 3
cvector_insert/8 3290 ns 3598 ns 195094
cvector_insert/64 26778 ns 26700 ns 28045
cvector_insert/512 227676 ns 219034 ns 3205
cvector_insert/4096 2592786 ns 2192785 ns 249
cvector_insert/32768 79741257 ns 71067122 ns 9
cvector_insert/65536 298786812 ns 280801800 ns 2
64 bit:
Run on (8 X 3492 MHz CPU s)
10/13/17 20:08:24
-------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------
devector_insert/8 1609 ns 1577 ns 524336
devector_insert/64 12828 ns 14185 ns 112179
devector_insert/512 117994 ns 156453 ns 4487
devector_insert/4096 1668282 ns 1813238 ns 499
devector_insert/32768 70929677 ns 80229086 ns 7
devector_insert/65536 278686251 ns 312002000 ns 2
cvector_insert/8 1603 ns 1596 ns 498572
cvector_insert/64 13468 ns 12724 ns 74786
cvector_insert/512 133092 ns 126901 ns 8974
cvector_insert/4096 2624790 ns 2561781 ns 408
cvector_insert/32768 140670228 ns 146640940 ns 5
cvector_insert/65536 624126003 ns 702004500 ns 1
I wonder why there is so little difference when the container is small.
I tried to replace int with std::array