Skip to content
This repository was archived by the owner on Jun 17, 2020. It is now read-only.
This repository was archived by the owner on Jun 17, 2020. It is now read-only.

View operations are extremely slow #8

@vitawasalreadytaken

Description

@vitawasalreadytaken

This is the first time I'm using zero_buffer so I'm not sure if this is a regression or if I'm doing something wrong. The following is run on head -n10000 /usr/share/dict/words:

$ time python3 bench_line_reading.py py
real    0m0.353s
user    0m0.334s
sys 0m0.016s

$ time python3 bench_line_reading.py zero_buffer
real    0m9.250s
user    0m9.226s
sys 0m0.019s

Profiling indicates that BufferView.__getitem__ and BufferView._split_char are the biggest culprits.

I tried to replace simple bytes-copying code with zero_buffer in a real-world parser I'm building and performance is also worse by orders of magnitude.

Python 3.4.1
cffi==0.8.6
zero-buffer==0.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions