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: Possible improvement in next_permutation implementation


David GONZALEZ MALINE wrote:
> I wonder whether it would be possible to make an implementation of the
> standard library method closer to what the gsl algorithm does. The
> three algorithms are intrinsically the same one, but the way they have
> been implemented differ in the small details, and that is what makes
> the difference in time.
I'm still checking a few things and performing microbenchmarks, but
apparently the performance gap is due to the fact that
std::next_permutation works with generic bidirectional iterators (i.e,
in the implementation we lack an overload optimized for random access
iterators).

Paolo.


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