pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.66k stars 249 forks source link

Performance overhead when performing array calculations #1086

Closed jkatz closed 1 year ago

jkatz commented 1 year ago

Related issue: https://github.com/tcdi/plrust/issues/275

There is some performance overhead when performing calculations on arrays compared to C, which is particularly noticeable on higher-dimensional arrays. The tests were carried out on PL/Rust, but per https://github.com/tcdi/plrust/issues/275#issuecomment-1489187564 this is related to how pgx extracts data from PostgreSQL arrays.

I don't have pgx-specific examples, but the PL/Rust examples are in https://github.com/tcdi/plrust/issues/275

eeeebbbbrrrr commented 1 year ago

This should be resolved in the forthcoming pgrx 0.8.0 release. Work on plrust to integrate the new zero-copy Array support hasn't begun yet.

jkatz commented 1 year ago

@eeeebbbbrrrr Great! Which is the reference commit / PR that does this in pgrx?