Construct Test¶
The test compared the construction times of vector_pro and std::vector with the same initial container size.
Additionally, since vector_pro did not assign default values to each element during initialization, the comparison also included the time consumed when default values were provided for both.
Test Code¶
See the full code at build_test 1 and build_test 2 .
We used three different element sizes (small, medium, large) for testing, with the number of elements ranging from 1 to 1901, increasing by 100 for each test.
To ensure the reliability of the test results in each scenario, we conducted 20 tests for each container and took the average. In the first 10 tests, vector_pro started first, while in the latter 10 tests, std::vector started first.
Result¶
The results of the first test are as follows. There is a significant difference in the construction time of vector_pro and std::vector for all initialization lengths.

The reason for not assigning default values to each element during initialization is that we believe these values will often be overwritten by other values in the end. This reasoning becomes more compelling as the size of the elements in the container increases.
Below are the results with default values provided, which show that in most cases, the time consumption is comparable between the two.
You can find detailed information on each test element, the time measurement functions used, and the system specifications under the project's directory.