Skip to content

Commit 38b65cc

Browse files
committed
Add Boost container attributes section
1 parent 1620287 commit 38b65cc

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

doc/container.qbk

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,6 +1314,79 @@ user can `#define BOOST_CONTAINER_MEMZEROED_POINTER_IS_NOT_ZERO` before includin
13141314

13151315
[endsect]
13161316

1317+
[section:some_comparisons Boost container attributes and comparison with standard library implementations]
1318+
1319+
[section:sizeof `sizeof` comparison across major implementations]
1320+
1321+
These two tables compare `sizeof(container)` across major implementations and Boost.Container.
1322+
1323+
[table:sizeof_comparison sizeof comparison in 32/64 bit systems
1324+
[[Container] [Boost.Container ] [libstdc++ (GCC)] [libc++ (Clang)] [Microsoft STL [footnote Uses heap-allocated sentinels for `list` and `[multi_]set/map`, resulting in a smaller `sizeof` but requiring allocation on construction.]]]
1325+
[[`vector`] [12 / 24] [12 / 24] [12 / 24] [12 / 24] ]
1326+
[[`deque`] [16 / 32] [40 / 80] [24 / 48] [20 / 40] ]
1327+
[[`list`] [12 / 24] [12 / 24] [12 / 24] [8 / 16] ]
1328+
[[`multi_set/map`] [16 / 32] [24 / 48] [12 / 24] [8 / 16] ]
1329+
[[`string` [footnote Boost.Container has a SSO size option
1330+
([classref boost::container::inline_chars inline_chars]) that changes the `sizeof`.
1331+
The number shown is the `sizeof` for the default SSO size]]
1332+
[12 / 24] [24 / 32] [12 / 24] [24 / 32] ]
1333+
]
1334+
1335+
[endsect]
1336+
1337+
[section:string_sso String Small String Optimization (SSO) comparison across major implementation]
1338+
1339+
This tables shows the number of characters (excluding the null terminator) that can be hold inline across major implementations and Boost.Container.
1340+
1341+
[table:sso_capacity SSO capacity for string
1342+
[[Mode] [Boost.Container [footnote Boost.Container has a SSO size selection (up to 127 characters) option called [classref boost::container::inline_chars inline_chars] ]]
1343+
[libstdc++ (GCC)] [libc++ (Clang)] [Microsoft STL]]
1344+
[[32 bit] [10] [15] [10] [15]]
1345+
[[64 bit] [22] [15] [22] [15]]
1346+
]
1347+
1348+
[endsect]
1349+
1350+
[section:deque_blocks `deque` implementation block/segment size comparison ]
1351+
1352+
`deque` implementations are based on a segmented array of blocks, and the block size is an important parameter that affects performance.
1353+
This table shows the block size in bytes for `deque` implementations across major implementations and Boost.Container.
1354+
1355+
[table:block_sizes Deque Block Sizes
1356+
[[Implementation] [Block Size in bytes] ]
1357+
[[Boost.Container] [512 (32-bit) / 1024 (64-bit) [footnote Boost.Container has an option to select the [classref boost::container::block_size block_size] ] ] ]
1358+
[[libstdc++ (GCC)] [512 ] ]
1359+
[[libc++ (Clang)] [4096] ]
1360+
[[Microsoft STL] [16] ]
1361+
]
1362+
1363+
[endsect]
1364+
1365+
[section:boost_sizeof `sizeof` value of Boost.Container containers]
1366+
1367+
[table:sizeof_comparison `sizeof` comparison between Boost Containers (in bytes)
1368+
1369+
This table shows the `sizeof` value of Boost.Container containers in 32 and 64 bit systems. Note that these values can be changed by configuration options
1370+
(like [classref boost::container::stored_size stored_size]) so they are shown here for the default configuration.
1371+
1372+
[[Container] [32-bit] [64-bit] ]
1373+
[[`vector`] [12] [24] ]
1374+
[[`deque`] [16] [32] ]
1375+
[[`devector`] [16] [32] ]
1376+
[[`segmented_vector`] [12] [24] ]
1377+
[[`stable_vector`] [20] [40] ]
1378+
[[`list`] [12] [24] ]
1379+
[[`slist`] [8] [16] ]
1380+
[[`map/set`] [16] [32] ]
1381+
[[`flat_[multi_]map/set` [footnote `boost::containter::flat_xxx` containers are by default ordered `vector`s, but these containers can be configure to use another container as the underlying sequence ] ]
1382+
[12] [24] ]
1383+
[[`string`] [12] [24] ]
1384+
]
1385+
1386+
[endsect]
1387+
1388+
[endsect]
1389+
13171390
[import ../../../tools/auto_index/include/auto_index_helpers.qbk]
13181391

13191392
[section:index_reference Indexes and Reference]

0 commit comments

Comments
 (0)