python的快速、无拷贝缓冲区

zero_buffer的Python项目详细描述


https://travis-ci.org/alex/zero_buffer.png?branch=master

zero_buffer是一个高性能的零拷贝实现 python的字节缓冲区。

Documentation在readthedocs上可用。

fromzero_bufferimportBuffer# Create a buffer which has space for 8192 bytes.b=Buffer.allocate(8192)withopen(path,"rb")asf:# Read up to 8192 bytes from the file into the bufferb.read_from(f.fileno())# Create a read-only view of the buffer, this performs no copying.view=b.view()# Split the view on colons, this returns a generator which yields sub-views# of the view.forpartinview.split(b":"):print(part)

zero_buffer适用于python 2.6、2.7、3.2、3.3和pypy。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java我是否需要构造一个带有*非final*但不可变字段的不可变类?   java如何使用jaxb读取属性?   java为什么不打印空值以外的任何内容?   java Struts2如何在不使用struts的情况下重定向到操作。xml?   java方法参数未在其实现中使用   在Java中更改终端内部的变量   Spring中的java依赖项注入失败   java如何使用getAttribute Selenium防止获取重复的HREF   优先级队列的java顺序不符合预期   java如何使用Spring TaskExecutor在应用程序的所有请求中使用单个任务池   java Firebase RecyclerView不会从数据库中检索项目并将其显示在屏幕上。屏幕是空的   java将YUV_420_888转换为字节数组   spring停止使用Java缓存文件   java在执行maven clean安装时,我在eclipse智能家居中遇到了这种错误   stream Java=下载缓冲区未满?冲洗/缓冲是如何工作的?   查询SQL server时重置java JDBC连接   java如何避免在两个函数中使用相同的逻辑。   转换java。lang.Boolean到Scala Boolean