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
malloc
instead of allocators.Jemalloc-friendly.
fbstring
automatically 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 ...
随机推荐
- DataTable和实体类通过反射相互转换
using System.Runtime.Serialization; using System.Data; using System.Reflection; using System.Collect ...
- 安装visio 2010:您的计算机上的Office 2003安装已损坏,安装程序无法继续。请删除或修复office 2003产品并重新运行安装程序
您的计算机上的Office 2003安装已损坏,安装程序无法继续.请删除或修复office 2003产品并重新运行安装程序 最近打算安装visio 2010时出现 以下错误: “您的计算机上的Of ...
- sql基础语法复习(二)-- 分组,连接的使用
一.深入学习 group by group by ,分组,顾名思义,把数据按什么来分组,每一组都有什么特点. 1.我们先从最简单的开始: select count(*) from tb1 group ...
- redis常用配置参数解析
本文主要总结一下redis常用的配置参数的用法: 以下参数决定redis运行方式,默认前台运行,修改为yes可以让redis以后台守护进程方式运行 daemonize no 以下参数指定redis的p ...
- 7.翻转句子中单词的顺序[ReverseWordOrderInSentence]
[题目] 输入一个英文句子,翻转句子中单词的顺序,但单词内字符的顺序不变.句子中单词以空格符隔开.为简单起见,标点符号和普通字母一样处理. 例如输入“I am a student.”,则输出“stud ...
- U盘传送容量与格式问题
问题 今天想将7.6G的文件拷到U盘里,提示u盘内存不足,其实内存为14+G. 解答 U盘格式对于U盘的传送大小有限制 下面为U盘三种不同格式的应用及优缺点 FAT32格式:为系统默认格式,具有极佳的 ...
- 【剑指offer】二叉树的镜像,C++实现(先序遍历)
原创博文,转载请注明出处!github地址 博客文章索引地址 1.题目 输入一颗二叉树,将二叉树变换为原二叉树的镜像,如下图所示: 2.思路 二叉树有0个节点 二叉树有1个节点 二叉树有 ...
- SimpliciTI无线开发 — 快速搭建低功耗、低成本无线传感器网络
一.初闻SimpliciTI SimpliciTI是TI在2007年宣布推出的针对小型简单RF网络的专有低功耗协议,因其简化了具体的实施操作,降低对微控制器资源的占用,故基于SimpliciTI的RF ...
- js获得分辨率
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/stri ...
- 20179223《Linux内核原理与分析》第二周学习笔记
第二周实验 本周学习情况: 学习了X86 cpu的几个寄存器及X86汇编指令: movl %eax,%edx edx=eax %表示一个寄存器,把eax内容放入edx,等号相当于把eax赋值给edx, ...