[Xapian-tickets] [Xapian] #785: Use std::string_view whenever possible
Xapian
nobody at xapian.org
Thu May 9 13:32:22 BST 2019
#785: Use std::string_view whenever possible
-------------------------+-------------------------
Reporter: Kronuz | Owner: olly
Type: enhancement | Status: new
Priority: normal | Milestone:
Component: Other | Version:
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
-------------------------+-------------------------
Comment (by Kronuz):
The other thing that could gain improvements is storing string_views
inside objects in place of strings when we know or can make sure the
actual string memory will be alive during the whole life of the object.
i.e. classes which have a member std::string will get a copy of the
string, instead, we could potentially save a lot of time if we keep a
string view instead... unless we know the “parent” string object is doomed
to be destroyed before the object currently containing the string is.
I’ll try to profile this to see where string copy constructors and string
copy assignments are called from within xapian during a real world usage
and report back the results.
--
Ticket URL: <https://trac.xapian.org/ticket/785#comment:5>
Xapian <https://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list