Thread

  1. Re: future of PQfn()

    Nathan Bossart <nathandbossart@gmail.com> — 2026-05-27T18:23:04Z

    On Tue, May 26, 2026 at 11:36:49PM +0200, Jelte Fennema-Nio wrote:
    > Could you share the simple LO test you were running here and/or rerun it
    > with this patch applied? I'd love to know if the patch reduces the
    > slowdown significantly, or if something else is the bottleneck.
    
    The test is just:
    
        int main()
        {
            PCconn *conn = PQsetdb(NULL, NULL, NULL, NULL, "postgres");
    
            for (int i = 0; i < 1000000; i++)
                lo_create(conn, i);
    
            for (int i = 0; i < 1000000; i++)
                lo_unlink(conn, i);
        }
    
    Before applying your patch -> 0.457 seconds (best of ~10)
    After applying your patch  -> 0.444 seconds (best of ~10)
    
    For reference, HEAD runs this test in 0.319 seconds.
    
    I've attached my work-in-progress patches here, in case you're interested.
    0001 switches the frontend LO interface to use prepared statements, and
    0002 removes PQfn() entirely.  0003 applies on top of those two and
    switches the frontend LO interface to use PQexecParams() instead.
    
    -- 
    nathan