On 7/31/2013 2:38 PM, Justin Lebar wrote:
1. How much, and where, should we be using standard C++ library
functionality in Mozilla code?
We've tuned tarray, nsthashtable, strings, etc. to meet our precise
needs, and the implementations are consistent across all platforms.
I can imagine things becoming quite messy we had three or four
different implementations of these classes (in the different stdlibs),
each with their own quirks, and if we couldn't change the
implementations to meet our needs.
For what it's worth, I don't think we can tenably replace nsTArray,
nsTHashtable, or ns*String with std:: counterparts across the entire
tree and expect any kind of performance enhancement. We also have needs
like sizeOfIncludingThis/sizeOfExcludingThis that can't be as easily
satisfied with STL code. Replacing const nsA[C]String & with a
std::string_view-esque class might provide a small performance
enhancement, but it would need some experimentation and boils the ocean.
It is possible to make our APIs match std::vector in usage, such that
nsTArray and std::vector could be used fairly interchangeably, and that
strikes me as a possibly worthwhile goal.
On the other hand, we have an increasing number of semi-autonomous C++
side libraries which are already using the STL. Since I don't do
development outside of the XPCOM-riddled hallways of Mozilla code, I
don't know to what degree the incongruous APIs cause friction at these
margins, but I would find it hard to be believe that no friction is
being generated.
--
Joshua Cranmer
Thunderbird and DXR developer
Source code archæologist
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform