Skip to content

Improve client's defaultsMiddleware performance#400

Open
tiagonapoli wants to merge 4 commits intomasterfrom
perf/defaults-middleware
Open

Improve client's defaultsMiddleware performance#400
tiagonapoli wants to merge 4 commits intomasterfrom
perf/defaults-middleware

Conversation

@tiagonapoli
Copy link
Copy Markdown
Contributor

@tiagonapoli tiagonapoli commented Jul 6, 2020

What is the purpose of this pull request?

Running tests on my computer I got around 50% improvement on times to get requests cached on memory.

To check the results you can:

  • Clone https://github.com/vtex/dev-tools-experiments
  • Run yarn on clients-cache-performance
  • Follow the instructions on the readme and run for example node stressCLI.js @vtex/api 1000 100, which will show the time to do 100 gets using the lib specified in the @vtex/api entry (which is the master branch). Then run node stressCLI.js @vtex/api1 1000 100, which will show the time to do 100 gets using the lib specified in this entry.

You can generate flame graphs too to compare the two libs:

yarn global add 0x
0x stressCLI.js @vtex/api 1000 1000000

There are flamegraphs that shows how the ramda functions are "hot" (you'll have to clone the repository and access the following):
https://github.com/vtex/dev-tools-experiments/tree/master/clients-cache-performance/memoryCache/flamegraphs

Types of changes

  • Performance improvement
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

@tiagonapoli tiagonapoli force-pushed the perf/defaults-middleware branch from fcbd641 to af526a4 Compare July 6, 2020 19:47
Signed-off-by: Tiago Martins Nápoli <napoli.tiago96@gmail.com>
Signed-off-by: Tiago Martins Nápoli <napoli.tiago96@gmail.com>
Signed-off-by: Tiago Martins Nápoli <napoli.tiago96@gmail.com>
Signed-off-by: Tiago Martins Nápoli <napoli.tiago96@gmail.com>
@tiagonapoli tiagonapoli force-pushed the perf/defaults-middleware branch from af526a4 to 30e7a40 Compare July 6, 2020 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant