This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [PATCH] more efficient mersenne_twister_engine::discard


On 08/22/2012 03:43 PM, Ulrich Drepper wrote:
The discard member function of the mersenne_twister_engine class is
unnecessarily inefficient.   It currently discard elements one-by-one.
  It is possible to discard with higher granularity by discarding the
entire internal buffer.  The attached patch implements this.  To avoid
duplication a new internal member function is introduced which
generates a new set of bits for the internal buffer.  The operator()
is changed to use it.
Great, thanks. By the way, I suspect that other discard member functions could be also improved (nobody touched the code since the initial implementation when all where some sort of trivial conforming implementation)

Paolo.


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