Skip to content

Measuring PGRX overhead with a Rust vs C extension benchmark #1967

@mllorente-msft

Description

@mllorente-msft

Hi all. As an exercise I rewrote an extension similar to pg_stats_statements where the extension counts the number of queries fired in a given time period. When benchmarking my Rust extension using PGRX against the extension written in C, I found about a ~10% decrease in total queries being fired, which to me indicates a slight overhead that PGRX had. Not sure if there is any similar discourse that exists on this topic, but just wanted to share my findings and see if anyone else has run a benchmark on comparing Rust and C extensions for postgres. On the discord, a couple users have discussed that the overhead can perhaps be attributed to SPI and variable types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions