Opened 9 years ago

Closed 9 years ago

#9648 closed Bugs (fixed)

string construction optimization - std::char_traits::copy could be used to avoid char by char copying

Reported by: Adam Romanek <romanek.adam@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: container
Version: Boost 1.54.0 Severity: Optimization
Keywords: Cc:

Description

As discussed on boost-users mailing list (see "[container.string] why isn't memcpy used in the internals?"), the performance of constructing boost::container::string from C string is a lot worse than in case of std::string. That's because boost::container::string does not use std::char_traits::copy for input C string copying but rather copies it character by character.

Environment:

  • Ubuntu 12.04 (i386)
  • gcc 4.6.4
  • Boost 1.54.0

Attachments (2)

boost_container_string_assign_optimization.patch (956 bytes ) - added by Adam Romanek <romanek.adam@…> 9 years ago.
fix proposal
boost_container_string_assign_optimization_v2.patch (983 bytes ) - added by Adam Romanek <romanek.adam@…> 9 years ago.
fix proposal (v2)

Download all attachments as: .zip

Change History (3)

by Adam Romanek <romanek.adam@…>, 9 years ago

fix proposal

comment:1 by Ion Gaztañaga, 9 years ago

Resolution: fixed
Status: newclosed

Fixed in develop branch, SHA-1: ba596fc83c4c8e565a32f728e6742dacb2b9d2fc

by Adam Romanek <romanek.adam@…>, 9 years ago

fix proposal (v2)

Note: See TracTickets for help on using tickets.