folly (facebook opensource library)

https://github.com/facebook/folly/blob/master/folly/docs/Overview.md

主要是对现有的boost和stl的某些内容进行速度和内存使用上的优化,其中大量的都是关于多线程和并发设计的优化,且对C11的特性都有所使用。


1.small_vector

  • Short-lived stack vectors with few elements (or maybe with ausually-known number of elements), if you want to avoid malloc.

    small_vector<int,2> vec;
    vec.push_back(0); // Stored in-place on stack
    vec.push_back(1); // Still on the stack
    vec.push_back(2); // Switches to heap buffer.


2. FBVector

和stl::vector的功能一致,但是性能提升很多,主要是修改了内存增加因子从2到1.5,  内存分配办法改进等等方面。


3. FBString

完全替代string且兼容性很好。


还有很多没有细看,如有性能的特别优化需求可以考虑使用。

https://github.com/facebook/folly/tree/master/folly/docs


你可能感兴趣的:(Facebook)