Chinaunix首页 | 论坛 | 博客
  • 博客访问: 526989
  • 博文数量: 122
  • 博客积分: 2024
  • 博客等级: 上尉
  • 技术积分: 1484
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-08 21:17
文章分类

全部博文(122)

文章存档

2012年(2)

2011年(25)

2010年(95)

分类: C/C++

2012-06-03 15:39:16

facebook今天开源了其底层的c++库
看了下介绍,很多有意思的东西,涉及很多boost,stl的东西,够底层。很多都看不懂:(  留着慢慢看吧


folly是基于c++11的一个组件,是boost库和std库的一个重要补充。效率和性能是folly设计的首要考虑因素
`Arena.h`, `ThreadCachedArena.h`
Simple arena for memory allocation: multiple allocations get freed all at once. With threaded version.


[`AtomicHashMap.h`, `AtomicHashArray.h`](AtomicHashMap.md)
High-performance atomic hash map with almost lock-free operation.
lock-free的hash_map的实现,很吸引人

[`Benchmark.h`](Benchmark.md)
A small framework for benchmarking code. Client code registers
benchmarks, optionally with an argument that dictates the scale of the
benchmark (iterations, working set size etc). The framework runs
benchmarks (subject to a command-line flag) and produces formatted
output with timing information.

性能测试的一个框架,性能测试是程序设计中很重要的一方面

`Bits.h`
Various bit manipulation utilities optimized for speed.
bit操作的优化,怎么优化的?

`ConcurrentSkipList.h`
An implementation of the structure described in [A Provably Correct
Scalable Concurrent Skip
List](~shanir/nir-pubs-web/Papers/OPODIS2006-BA.pdf)
by Herlihy et al.
skip list 的实现,redis中zset就是这么搞的


A variety of data conversion routines (notably to and from string),
optimized for speed and safety.
数据转换?

`DiscriminatedPtr.h`

Similar to `boost::variant`, but restricted to pointers only. Uses the
highest-order unused 16 bits in a pointer as discriminator. So
`sizeof(DiscriminatedPtr) == sizeof(void*)`.
不明白

[`dynamic.h`](Dynamic.md)

Dynamically-typed object, created with JSON objects in mind.
动态类型跟json有什么关系?

`Endian.h`
Endian conversion primitives.
大小端转化

`Escape.h`
Escapes a string in C style.
???

`eventfd.h`
Wrapper around the
[`eventfd`]()
system call.
eventfd的一个封装,eventfd比pipe简单高效,多用于多线程/多进程间的wait/noitfy唤醒机制

[`FBString.h`](FBString.md)
A drop-in implementation of `std::string` with a variety of optimizations.
[`FBVector.h`](FBVector.md)
A mostly drop-in implementation of `std::vector` with a variety of
optimizations.
`Foreach.h`
Pseudo-statements (implemented as macros) for iteration.
对stl string,vector,for_each的优化

[`Format.h`](Format.md)
Python-style formatting utilities.
把c++的代码转化成python风格的格式?

`Hash.h`
Various popular hash function implementations.
这个不错

`json.h`
JSON serializer and deserializer. Uses `dynamic.h`.
json的序列化和反序列化

`Malloc.h`
Memory allocation helpers, particularly when using jemalloc.
??

`MapUtil.h`
Helpers for finding items in associative containers (such as
`std::map` and `std::unordered_map`).
map容器的一些扩展?

[`PackedSyncPtr.h`](PackedSyncPtr.md)
A highly specialized data structure consisting of a pointer, a 1-bit
spin lock, and a 15-bit integral, all inside one 64-bit word.
这干嘛的?

`Preprocessor.h`
Necessarily evil stuff. 
似乎是好东西,有兴趣了。。。。

`PrettyPrint.h`
Pretty-printer for numbers that appends suffixes of unit used: bytes
(kb, MB, ...), metric suffixes (k, M, G, ...), and time (s, ms, us,
ns, ...).
打印的一个扩展

[`ProducerConsumerQueue.h`](ProducerConsumerQueue.md)
Lock free single-reader, single-writer queue.
很经典的读写队列

`Range.h`
Boost-style range facility and the `StringPiece` specialization.
不懂

`Random.h`
Defines only one function---`randomNumberSeed()`.
随机数生成器?

`RWSpinLock.h`
Fast and compact reader-writer spin lock.
用户空间的自旋锁?

`small_vector.h`
Vector with the small buffer optimization and an ptional embedded
`PicoSpinLock`.
小数据vector的优化

####`sorted_vector_types.h`
Collections similar to `std::map` but implemented as sorted vectors.
sorted vector?设计这个的初衷在哪儿?

####`StlAllocator.h`
STL allocator wrapping a simple allocate/deallocate interface.
对stl的分配器进行了封装?

####`String.h`
String utilities that connect `folly::fbstring` with `std::string`.


####[`Synchronized.h`](Synchronized.md)
High-level synchronization library.
同步库?这干嘛的?

####`System.h`
Demangling and errno utilities.
系统相关的功能?

####[`ThreadCachedInt.h`](ThreadCachedInt.md)
High-performance atomic increment using thread caching.

####[`ThreadLocal.h`](ThreadLocal.md)
Improved thread local storage for non-trivial types.
多线程相关

####`TimeoutQueue.h`
Queue with per-item timeout.
队列的每一项都有失效时间

####`Traits.h`
Type traits that complement those defined in the standard C++11 header
``.

####`Unicode.h`
Defines the `codePointToUtf8` function.
转化成utf-8编码?

附录:
c++11的一些资料
http://blog.csdn.net/lanphaday/article/details/6564162
skip-list
event-fd

阅读(4151) | 评论(4) | 转发(0) |
1

上一篇:c++ 中的临时变量

下一篇:没有了

给主人留下些什么吧!~~

pybmsk2012-11-03 16:47:58

PTC Creo 2.0 M010 Full Multilanguage WinALL-ISO 2DVD

PTC Creo/Illustrate (ex PTC IsoDraw) 2.0 WinALL-ISO 1DVD

PTC Creo Schematics (ex Routed Systems Designer) 2.0 M010-ISO 1CD

PTC Pro/E WildFire+Pro/Mechancia v6.0 Alpha Win32-ISO 3CD

PTC Creo Elements/Pro 5.0 M070 Working for Win32-ISO 1DVD(最新多语言正式版包括简、繁体中文)

PTC Creo Elements/Pro 5.0 M070 Working for Win64-ISO 1DVD

PTC Creo Elements View (ex Product View) v

Aquester2012-06-06 09:24:18

sandflee: 嗯,这东西学习下很不错.....
博主可多分享些这方面的信息

sandflee2012-06-05 19:12:01

Aquester: 从微薄上看到的消息,很强的基础类库.....
嗯,这东西学习下很不错

Aquester2012-06-04 13:04:28

从微薄上看到的消息,很强的基础类库