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]

[v3] Optimize the default constructors of the sampling distributions


Hi,

when I fixed very easily the small issue with the call operator of
piecewise_linear_distribution segfaulting for the default constructed
object, I noticed that indeed the call operators of *all* the sampling
distributions were easy to tweak to deal at the outset with the special
case of a default constructed object, with no need to extract
information from the std::vector data members of param_type. Thus the
idea of uniformly having such data members empty (ie, default
constructed) for the default constructed object (and also all the cases
where the input parameters are equivalent to the default constructed
case, in this way operator== still works fine, see the _M_initialize
changes), thus speeding up the constructor and avoiding allocating
dynamic memory.

I'm finishing testing the below, on x86_64-linux multilib.

Paolo.

Attachment: CL_random
Description: Text document

Attachment: patch_random
Description: Text document


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