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]

Q on how to speed up num_put::_M_insert?


[trying a second time]

I've got the rest of my IO speedup patch working with the exception of the
linkage issues.  I'll try to put up my revised patch tomorrow.

I'm now trying to figure out the best way to add in the last
optimization I had, which is to use streambuf::sputn in place of the streambuf
iterator.  Hacking this in, I get a 2 second reduction in execution time (9.7
down to 7.8), so it is definitely worth pursuing.

What I was hoping to do, was to have a specialized version of
num_put::_M_insert for num_put<_CharT, ostreambuf_iterator<_CharT> >.  It also
requires making num_put a friend of ostreambuf_iterator.  However, I can't
figure out how to get the compiler to accept a routine specialized this way.

I've tried:

template<typename _CharT>
  ostreambuf_iterator<_CharT>
  num_put<_CharT, ostreambuf_iterator<_CharT> >::_M_insert()

and variations on a theme, but I can't find the right incantation.  I suppose
it's possible I can't do it this way, but it seemed to be an elegant
solution.

Any suggestions on getting this right or other approaches solving the problem?

Thanks,
Jerry Quinn


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