The Wayback Machine - https://web.archive.org/web/20220508010919/https://github.com/graphile/postgraphile/pull/1077
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

feat(perf): performance enhancements #1077

Merged
merged 43 commits into from May 17, 2019
Merged

feat(perf): performance enhancements #1077

merged 43 commits into from May 17, 2019

Conversation

Copy link
Member

@benjie benjie commented May 17, 2019

  • Use Graphile's LRU cache
  • Dereference more
  • Move first request handler into its own function that can become a noop
  • Reduce number of unnecessary await calls
  • Reduce logic in hot paths
  • Use Object.create(null) to remove the need for Object.hasOwnProperty call
  • Set value to undefined rather than performing delete (JSON.stringify treats both as non-existent)
  • Don't define dynamic functions during each request for requestHandler.then(...) arguments
  • Quick return from pluginHook if no hooks are registered
  • Instrument the pgClient instances once up front rather than checking each time one is grabbed from the pool
  • Add a simplified withAuthenticatedPgClient function to use when no transaction is required (less branching)
  • Remove unnecessary async/await from function that was actually synchronous
  • Environmental variable GRAPHILE_TURBO=1 opts into TypeScript esnext compile target; requires Node v12+ (?)
@benjie benjie merged commit d237417 into master May 17, 2019
4 checks passed
@benjie benjie deleted the perf branch May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant