Skip to content

Idea to improve performance of parsing by ~3x #20

Closed

Description

@henrinormak

First of all, thanks for all the hard work, this library has been instrumental for our use at @6fold and we truly appreciate that.

Recently we underwent a lot of performance profiling and optimising of some of our core code, during which we noticed that parsing dates is taking quite a lot of CPU cycles. After some experimentation, we ended up with our own parser that is about 3x as fast as the parser in this package.

We would love to contribute this back (we kept the test suite the same, so the two should be functionally equivalent), what is the preferred way, should we just open a PR against this package with the re-write?

We are asking as the alternative could also be to contribute a PR to upstream (in our case https://github.com/brianc/node-pg-types) with a PR to swap out the date parsing library.

EDIT: Here's a link to our package that contains the faster implementation - https://github.com/6fold/fast-postgres-date-parser

Activity

  1. changed the title [-]Idea to improve performance of parsing by 4x[/-] [+]Idea to improve performance of parsing by ~3x[/+] on Feb 23, 2021
  2. bendrucker commented on Feb 23, 2021

    @bendrucker
    Owner

    Hi! Much of the pg types code has a long history before me and much of it isn't performance tested. I've had folks contribute similar rewrites for other packages. PRs are very much welcome if they come with matching tests and benchmarks to prove the perf improvements. Sounds like you already have both, so should be an easy one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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