GroupVarint
folly/GroupVarint.h
folly/GroupVarint.h
is an implementation of variable-length encoding for 32- and 64-bit integers using the Group Varint encoding scheme as described in Jeff Dean's WSDM 2009 talk and in Information Retrieval: Implementing and Evaluating Search Engines.
Briefly, a group of four 32-bit integers is encoded as a sequence of variable length, between 5 and 17 bytes; the first byte encodes the length (in bytes) of each integer in the group. A group of five 64-bit integers is encoded as a sequence of variable length, between 7 and 42 bytes; the first two bytes encode the length (in bytes) of each integer in the group.
GroupVarint.h
defines a few classes:
GroupVarint<T>
, whereT
isuint32_t
oruint64_t
:Basic encoding / decoding interface, mainly aimed at encoding / decoding one group at a time.
GroupVarintEncoder<T, Output>
, whereT
isuint32_t
oruint64_t
, andOutput
is a functor that acceptsStringPiece
objects as arguments:Streaming encoder: add values one at a time, and they will be flushed to the output one group at a time. Handles the case where the last group is incomplete (the number of integers to encode isn't a multiple of the group size)
GroupVarintDecoder<T>
, whereT
isuint32_t
oruint64_t
:Streaming decoder: extract values one at a time. Handles the case where the last group is incomplete.
The 32-bit implementation is significantly faster than the 64-bit implementation; on platforms supporting the SSSE3 instruction set, we use the PSHUFB instruction to speed up lookup, as described in SIMD-Based Decoding of Posting Lists(CIKM 2011).
For more details, see the header file folly/GroupVarint.h
and the associated test file folly/test/GroupVarintTest.cpp
.
GroupVarint的更多相关文章
- 今天听说了一个压缩解压整型的方式-group-varint
group varint https://github.com/facebook/folly/blob/master/folly/docs/GroupVarint.md 这个是facebook的实现 ...
- folly学习心得(转)
原文地址: https://www.cnblogs.com/Leo_wl/archive/2012/06/27/2566346.html 阅读目录 学习代码库的一般步骤 folly库的学习心得 ...
- Folly: Facebook Open-source Library Readme.md 和 Overview.md(感觉包含的东西并不多,还是Boost更有用)
folly/ For a high level overview see the README Components Below is a list of (some) Folly component ...
随机推荐
- 浅析C#中ASP.NET页面的生存周期
一般来说,页要经历下表概述的各个阶段.除了页生命周期阶段以外,在请求前后还存在应用程序阶段,但是这些阶段并不特定于页. 阶段 说明 页请求 页请求发生在页生命周期开始之前.用户请求页时,ASP.NET ...
- sar工具使用详细介绍
一:命令介绍:参考资料:http://linux.die.net/man/1/sar sar(System ActivityReporter系统活动情况报告)是目前Linux上最为全面的系统性能分析工 ...
- JVM的理解
1.Java程序是交由JVM执行的,所以我们在谈Java内存区域划分的时候事实上是指JVM内存区域划分.在讨论JVM内存区域划分之前,先来看一下Java程序具体执行的过程: 也相当与 注:JVM(ja ...
- Android程序员学WEB前端(6)-CSS(1)-选择器-Sublime
转载请注明出处:http://blog.csdn.net/iwanghang/article/details/76576469 觉得博文有用,请点赞,请评论,请关注,谢谢!~ CSS外部文档链接: & ...
- React-Native进阶_2.加载指示动画 ActivityIndicator
在安卓原始 App中使用的加载框 ProgressBar 在React -Native 中也是有相对应的视图,叫做ActivityIndicator,对应ios 中React-Native 提供的是 ...
- Qt QScrollArea and layout in code
Qt QScrollArea and layout in code 一.参考文档: . Qt 第六章 QScrollArea类给QWidget添加滚动条 http://blog.csdn.net/co ...
- Oracle基本概念与数据导入
Oracle基本概念 实例 一个Oracle实例(Oracle Instance)有一系列的后台进程(Backguound Processes)和内存结构(Memory Structures)组成.一 ...
- SVN 如何更新整个目录
SVN 有时会遇到更新整个目录的情况, 比如依赖的某个库有了新版本, 需要更新. 这个时候的处理可能需要注意一些问题.(直接跳到最后看结论) 举个例子: 根文件是 test, 里面用 external ...
- java大文件断点续传
java两台服务器之间,大文件上传(续传),采用了Socket通信机制以及JavaIO流两个技术点,具体思路如下: 实现思路:1.服:利用ServerSocket搭建服务器,开启相应端口,进行长连接操 ...
- hadoop、storm和spark的区别、比较
一.hadoop.Storm该选哪一个? 为了区别hadoop和Storm,该部分将回答如下问题:1.hadoop.Storm各是什么运算2.Storm为什么被称之为流式计算系统3.hadoop适合什 ...