Skip to content

Cython-level filtering #14

@fungibit

Description

@fungibit

It would be nice if we could avoid creating python object if the user is going to filter them out anyway. That could be significant speed-wise.

It requires defining a simple query language. "projection" would also be a nice feature.

For examples:

for txid in iter_txs().filter(num_inputs__gt = 5).projection(['txid']):
    print(txid)

Since the filtering (and projection) will be implemented in cython-space, before creating the Tx objects, this is supposed to be massively faster than:

for tx in iter_txs():
    if len(tx.inputs) > 5:
        print(tx.txid)

(The query-language used here is inspired by Django.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions