Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All changes for LoyaltyLion #1

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

All changes for LoyaltyLion #1

wants to merge 23 commits into from

Commits on Nov 20, 2020

  1. tweak package.json, etc for our fork

    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    6b9f118 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0d9b091 View commit details
    Browse the repository at this point in the history
  3. deprecate setLock in favour of lockMode

    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    6bd2aea View commit details
    Browse the repository at this point in the history
  4. add lock method to SelectQueryBuilder

    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    b59090f View commit details
    Browse the repository at this point in the history
  5. publish 0.2.9-1

    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    935d919 View commit details
    Browse the repository at this point in the history
  6. publish 0.2.10-1

    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    27a0425 View commit details
    Browse the repository at this point in the history
  7. add TransactionalEntityManager type

    This type is used instead of a regular EntityManager in the
    EntityManager.prototype.transaction callback. It extends an
    EntityManager, so can be used as normal, but is not assignable to one,
    so functions and services can require this type in order to assert they
    receive a manager that has already started a transaction
    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    c42b2c0 View commit details
    Browse the repository at this point in the history
  8. publish 0.2.10-2

    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    27c2c06 View commit details
    Browse the repository at this point in the history
  9. publish 0.2.10-3

    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    d076c24 View commit details
    Browse the repository at this point in the history
  10. set and unset activeTransaction flag on databaseConnection

    LL specific change - our legacy services use this field to determine
    if a transaction is active or not, if we don't manage it via
    typeorm then it's possible legacy clients will still think they
    are in a transaction when they're not
    atreidesend authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    df1c230 View commit details
    Browse the repository at this point in the history
  11. update package to 0.2.10-4

    atreidesend authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    10decce View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2dd6468 View commit details
    Browse the repository at this point in the history
  13. remove bad connections from the postgres pool after a failed query

    typeorm currently lets pg.pool assume that clients are always safe to
    add back into the pool, even if it encountered an error while running
    a query. this is /usually/ fine, because the vast majority of errors
    that happen during a query do not cause the client's connection itself
    to become inoperable
    
    however, if, during a query, the client's connection is killed, the
    query will fail and the client will be placed back into the pool even
    though it's linked to a now broken connection, i.e. that client will
    never work again, but because pg.Pool doesn't know that, it'll keep
    handing it out. end result: lots of failed queries
    
    this patches `Connection.prototype.query` so that it passes the error
    back to the driver when it calls `queryRunner.release`. the driver can
    (if applicable) then inspect the error and decide if it should result
    in the client being removed from the pool or just released as normal
    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    7fe3ea8 View commit details
    Browse the repository at this point in the history
  14. publish 0.2.20-1

    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    f82e66e View commit details
    Browse the repository at this point in the history
  15. remove clients from the pool following any error

    we're not confident in our ability to accurately determine what a "bad"
    error (i.e. one that has rendered the connection broken). to be safe,
    we'll instruct the pool to remove any client that failed to execute
    a query
    
    though this will result in more pool churn, we're using pgbouncer so
    those connections are cheap, and this provides maximum safety overall
    clarkdave authored and tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    4e88776 View commit details
    Browse the repository at this point in the history
  16. Bumped node version to 13.7.0

    tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    a2fd785 View commit details
    Browse the repository at this point in the history
  17. Bump to version 0.2.20-3

    tom committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    fb16ecd View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2022

  1. Configuration menu
    Copy the full SHA
    330a751 View commit details
    Browse the repository at this point in the history
  2. test: add benchmark for select querybuilder (typeorm#8955)

    Motivation: the query builder (and within it, replacePropertyNames and
    associated functions) is pretty CPU intensive. For our workload, it's
    one of the hottest functions in our entire stack.
    
    While improved in typeorm#4760,
    There are still outstanding issues relating to perf e.g. typeorm#3857
    
    As we all know though, the first step in optimization is to measure
    systematically ;)
    
    https://wiki.c2.com/?ProfileBeforeOptimizing
    
    On my machine, this benchmark runs in ~3500ms or about 0.35ms/query.
    This tells us there's a way to go - on my stack, that's about 1/3 of a
    typical query's latency!
    draaglom authored and frangz committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    bda2c2c View commit details
    Browse the repository at this point in the history
  3. perf: don't recompile escapeRegExp for every query (typeorm#8956)

    Context: the query builder is pretty CPU intensive, and can be slow -
    e.g. typeorm#3857
    
    One of the things which makes this slow is `escapeRegExp` in the query
    builder: we freshly construct the same RegExp once per
    `replacePropertyName` invocation (many times per overall query!) and
    since the RegExp itself is constant -- we can lift it out and construct
    it once.
    
    Over-all this saves about 8% on our query build times as measured by
     typeorm#8955.
    draaglom authored and frangz committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    1631cfb View commit details
    Browse the repository at this point in the history
  4. perf: partially lift matching from regexp to js (typeorm#9032)

    Digging further into typeorm#3857.
    
    See also typeorm#8955, typeorm#8956.
    
    As [previously
    discussed](typeorm#3857 (comment)),
    the query builder currently suffers from poor performance in two ways:
    quadratic numbers of operations with respect to total table/column
    counts, and poor constant factor performance (regexps can be expensive
    to build/run!)
    
    The constant-factor performance is the more tractable problem: no longer
    quadratically looping would be a chunky rewrite of the query builder,
    but we can locally refactor to be a bunch cheaper in terms of regexp
    operations.
    
    This change cuts the benchmark time here in ~half (yay!).
    
    We achieve this by simplifying the overall replacement regexp (we don't
    need our column names in there, since we already have a plain object
    where they're the keys to match against) so compilation of that is much
    cheaper, plus skipping the need to `escapeRegExp` every column as a
    result.
    draaglom authored and frangz committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    925fa85 View commit details
    Browse the repository at this point in the history
  5. Increment version

    frangz committed Nov 14, 2022
    Configuration menu
    Copy the full SHA
    405f688 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    afb5e11 View commit details
    Browse the repository at this point in the history