Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: porsager/postgres
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: dlbeer/postgres
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Aug 3, 2021

  1. connection: fix O(n^2) reply parsing.

    The data method in the Connection object handles incoming data chunks by
    concatenating them with a Buffer object. If the data chunks are each of
    bounded size, then this algorithm is O(n^2) in the total size of the
    reply.
    
    This leads to excessive CPU consumption and hangs when the replies are
    large -- reading a 40 MB BYTEA causes a very long pause when tested
    here.
    
    This commit introduces an efficient double-ended queue, with O(n) push
    and shift operations, and uses that instead of allocating a new
    concatenated Buffer for each chunk.
    Daniel Beer authored and dlbeer committed Aug 3, 2021
    Configuration menu
    Copy the full SHA
    04c93b7 View commit details
    Browse the repository at this point in the history
Loading