Skip to content

Can the parsing performance be improved by using a precomputed index? #128

Closed
@KOLANICH

Description

@KOLANICH

Hi. I use your parser to parse large (in fact not very large, from 200 MiB to 2 GiB each file is) CSV datasets consisting mostly of strings. No DB functionality is needed, so I feel like moving the data into a real DB as a preprocessing step will not bring any benefit.

Also I cache intermediate results into plain text files, one record per a line, but lines are not necessarily CSV.

I have designed a file format (mostly a prefix tree with additional data in each non-leaf node, just not to waste space) allowing one to save the offsets of line breaks for getting a record by its line number fast.

I have also extended it to hold arbitrary shapes. So we can save not only line breaks, but other separators, like commas (and no separators at all). The format seems to be very versatile and multipurpose.

But all of that scannjng code is currently coded in python. Intel Hyperscan (a fast large scale jitted AVX-accelerated regex matching engine used in DPIs) is not useful, since it cannot match subgroups.

I wonder if we can accelerate parsing by first precomputing the index file (it is very likely it can even be done on GPU, though I am not sure if it will bring any benefit) and saving it (done once), then by using the offsets from it (can be done multiple times) to avoid scanning and tokenizing entirely.

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