This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: performance analysis producer_consumer.cc TEST_T5


[Loren, sorry for the duplicate. -- fwy]

>  I'm not the author of that sequence of tests but it looks OK to me
>  (although it has a quirk that makes the actual workload of the
>  producer-consumer path non-deterministic...).

If you're referring to the fact that the result depends on how the operating system schedules the producer and consumer threads, then we have the same quirk in mind.

When I wrote the first version of this test (which may be virtually identical to the one that's being run), it never occurred to me that a container wouldn't cache its size, so the queue's push_back method is much less efficient than it should be. It should call empty() before insert(), and then signal when appropriate. Otherwise, it may traverse the entire sequence before discovering that its length is (not) 1. Oops!

>  BTW, all these tests are artificial (IMHO w.r.t. good thread design)
>  in that they over-stress the communication between threads

I agree, but I don't think the good designs produce meaningful statistics. In the spirit of the older tests, we're just trying to exercise the allocator and measure how long it took to do so.


Felix



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]