small medium large xlarge

Generic-user-small
03 Dec 2014, 13:17
Arnd R.Strube (88 posts)

I sincerely hope I am not the only one posting here anymore???

I noticed strange timings in the example from Chapter 9 / 4. I added several additional timers to come up with the following:

setup() elapsed time = 1950 ms
usersInBox() elapsed time = 187 ms
teardown() elapsed time = 0 ms
TEST_GROUP(AGeoServer_StressTest) elapsed time = 239310 ms

Unlike the book code, I used pointer semantics to be able to monitor destruction of the server object as well and to ensure destruction of the memory allocated by std:: container objects.

Where is the bulk of this overproportionately long time spent?

Generic-user-small
03 Dec 2014, 15:55
Arnd R.Strube (88 posts)

Okay, in this forum it seems customary to answer your own questions. So here goes.

After correcting an error with timer creation, results are now:

TEST(AGeoServer_StressTest, HandlesLargeNumbersOfUsers)
setup() elapsed time = 374 ms
usersInBox() elapsed time = 31 ms
teardown() elapsed time = 8237 ms
 - 8643 ms

In other words, for 100000 users (I didn’t have the patience to wait for 500000) - 31 ms are consumed by the function we are testing. 374 ms (x 12) are consumed by creating the object in setup(). And a whopping 8.237 ms (x 265) are consumed by destruction of the server in teardown()!

You must be logged in to comment