FBString
folly/FBString.h
fbstring is a drop-in replacement for std::string. The main benefit of fbstring is significantly increased performance on virtually all important primitives. This is achieved by using a three-tiered storage strategy and by cooperating with the memory allocator. In particular, fbstring is designed to detect use of jemalloc and cooperate with it to achieve significant improvements in speed and memory usage.
fbstring supports 32- and 64-bit and little- and big-endian architectures.
Storage strategies
Small strings (<= 23 chars) are stored in-situ without memory allocation.
Medium strings (24 - 255 chars) are stored in malloc-allocated memory and copied eagerly.
Large strings (> 255 chars) are stored in malloc-allocated memory and copied lazily.
Implementation highlights
100% compatible with
std::string.Thread-safe reference counted copy-on-write for strings "large" strings (> 255 chars).
Uses
mallocinstead of allocators.Jemalloc-friendly.
fbstringautomatically detects if application uses jemalloc and if so, significantly improves allocation strategy by using non-standard jemalloc extensions.find()is implemented using simplified Boyer-Moore algorithm. Casual tests indicate a 30x speed improvement overstring::find()for successful searches and a 1.5x speed improvement for failed searches.Offers conversions to and from
std::string.
FBString的更多相关文章
- Folly解读(零) Fbstring—— 一个完美替代std::string的库
string 常见的三种实现方式 eager copy COW SSO Fbstring 介绍 Storage strategies Implementation highlights Benchma ...
- 用#define来实现多份近似代码 - map,set中的应用
在stl中map,set内部都是使用相同的红黑树实现,map对应模板参数key_type,mapped_type,而set对应模板参数没有mapped_type 两者都支持insert操作 pair& ...
- 转: 在创业公司使用C++
from: http://oicwx.com/detail/827436 在创业公司使用C++ 2016-01-04开发资讯 James Perry和朋友创办了一家公司,主要是做基于云的OLAP多维数 ...
- issues about Facebook Login
在学习The complete iOS 9 Developer Course - Build 18 Apps 中的Letture134-Facebook Login,需要整合(integrate)Pa ...
- Conv
folly/Conv.h folly/Conv.h is a one-stop-shop for converting values across types. Its main features a ...
- DynamicConverter
folly/DynamicConverter.h When dynamic objects contain data of a known type, it is sometimes useful t ...
- ProducerConsumerQueue
folly/ProducerConsumerQueue.h The folly::ProducerConsumerQueue class is a one-producer one-consumer ...
- folly学习心得(转)
原文地址: https://www.cnblogs.com/Leo_wl/archive/2012/06/27/2566346.html 阅读目录 学习代码库的一般步骤 folly库的学习心得 ...
- Java UDP的简单实例以及知识点简述
UDP的实现 Java中实现UDP协议的两个类,分别是DatagramPacket数据包类以及DatagramSocket套接字类. 其与TCP协议实现不同的是: UDP的套接字DatagramSoc ...
随机推荐
- c# 获取随机数字/字符/时间
using System; using System.Text; namespace HuaTong.General.Utility { /// <summary> /// 随机字符/数字 ...
- spring framework各个版本下载网址
spring framework各个版本下载网址 http://repo.spring.io/simple/libs-release-local/org/springframework/spring/
- 编写configure.ac
configure.ac由一些宏组成(如果已经有源代码,你可以运行autoscan来产生一个configure.scan文件,在此基础修改成configure.ac将更加方便) 最基本的组成可以是下面 ...
- React-Native进阶_3.触摸高亮显示TouchableHighlight
在安卓原生ListView 点击 其中一个子视图时,会有高亮效果,这个效果在ReactNative 中通过TouchableHighlight 实现,具体使用如下 4.触摸高亮显示 Touchabl ...
- 在VC2015里包含了lib库,但没有设置对路径的出错
它的提示出错如下: 这时需要在路径: 在附加的目录里添加上lib的路径. 1. RPG游戏从入门到精通 http://edu.csdn.net/course/detail/5246 2. WiX安装工 ...
- BJOI 模拟赛 #3 题解
T1 一个网格,每个点有权值,求有多少条路径权值乘积不小于 $n$ $R,C \leq 300, n \leq 10^6$ sol: 暴力 dp 是 $O(R \times C \times n)$ ...
- Luogu 3690 Link Cut Tree
Luogu 3690 Link Cut Tree \(LCT\) 模板题.可以参考讲解和这份码风(个人认为)良好的代码. 注意用 \(set\) 来维护实际图中两点是否有直接连边,否则无脑 \(Lin ...
- BZOJ 2530 Poi2011 Party 【枚举】
BZOJ 2530 Poi2011 Party Description Byteasar intends to throw up a party. Naturally, he would like i ...
- 通过解读 WPF 触摸源码,分析 WPF 插拔设备触摸失效的问题(问题篇)
在 .NET Framework 4.7 以前,WPF 程序的触摸处理是基于操作系统组件但又自成一套的,这其实也为其各种各样的触摸失效问题埋下了伏笔.再加上它出现得比较早,触摸失效问题也变得更加难以解 ...
- turtle海龟作图
个人心得:python这么火是有他的原因的,突然发现他的语言很有趣,库函数也很多. 这次是第一步,简单了解了一下turtle函数 import turtle import time def drawS ...