citp / BlockSci

A high-performance tool for blockchain science and exploration
https://citp.github.io/BlockSci/
GNU General Public License v3.0
1.34k stars 259 forks source link

performance: consider not using proxies for normal properties/methods #316

Open maltemoeser opened 5 years ago

maltemoeser commented 5 years ago

Currently (on v0.6) accessing properties and methods of Python objects involves a function call to the corresponding proxy object (._self_proxy), which incurs a performance overhead that becomes significant for large numbers of individual objects. (e.g., [tx.fee for block in chain for tx in block] instead of chain.blocks.txes.fee). However, not all analyses may be doable using the proxy interface. We should consider whether we can use traditional properties and methods for these objects.

Related: #295, #311

maltemoeser commented 5 years ago

I've started an experimental branch for this, available in https://github.com/citp/BlockSci/pull/318