[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pan-users] Bug 756458 pan 0.139 crashes on start
From: |
Zan Lynx |
Subject: |
Re: [Pan-users] Bug 756458 pan 0.139 crashes on start |
Date: |
Wed, 6 Jan 2016 14:21:36 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
On 01/06/2016 12:19 PM, Rhialto wrote:
> So keeping every step of the way in the StringView realm is definitely
> better. Whether the actual string storage is safe in the long term, I
> didn't look at, but presumably it is or more things would go wrong
> (probably).
Whereas I believe the opposite: every StringView used in the preference
code should be replaced with a simple std::string. The performance
gained by objects like StringView only apply when taking substrings of
large objects or in areas where repeated memory allocation /
deallocation show up in profiler results.
With small strings which often fit into the short string area creating a
new std::string and copying the string content is a very cheap
operation. When it comes to memory copies anything that fits into one or
even two cache lines can be completed in about 8 CPU cycles using a
series of 64-bit/8-byte MOVs. It is the very definition of trivial.