question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Massive performance degradation since v1.7.5

See original GitHub issue

using node v12.18.3

Version 1.7.5 introduced a regression which causes a massive performance degradation.

Test code:

const fs = require('fs');

const git = require('isomorphic-git');

const dir = '.';
const filepath = 'README.md';
const ref = 'master';

const run = async (label) => {
  console.time(label); 
  
  console.time('resolveRef'); 
  const commitSha = await git.resolveRef({ fs, dir, ref });
  console.timeEnd('resolveRef'); 

  console.time('status'); 
  const status = await git.status({ fs, dir, filepath });
  console.timeEnd('status'); 

  console.time('readObject #1'); 
  const { oid } = await git.readObject({ fs, dir, oid: commitSha, filepath });
  console.timeEnd('readObject #1'); 

  console.time('readObject #2'); 
  const { object: content } = await git.readObject({ fs, dir, oid });
  console.timeEnd('readObject #2'); 

  console.timeEnd(label); 
}

const main = async () => {
  await run('total run #1');
  await run('total run #2');
}

main().catch(err => console.log(err));

I’ve tested with this repository: https://github.com/davidnuescheler/pages

Results using 1.7.4:

resolveRef: 2.276ms
status: 364.792ms
readObject #1: 2.695ms
readObject #2: 1.940ms
total run #1: 376.457ms

resolveRef: 0.672ms
status: 9.638ms
readObject #1: 2.091ms
readObject #2: 1.598ms
total run #2: 14.323ms

Results using 1.7.5:

resolveRef: 2.181ms
status: 359.206ms
readObject #1: 224.917ms
readObject #2: 228.641ms
total run #1: 819.938ms

resolveRef: 2.451ms
status: 247.968ms
readObject #1: 218.427ms
readObject #2: 229.541ms
total run #2: 698.930ms

=> The second run takes ~40-50x longer using 1.7.5.

related issue: #1237

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
stefan-guggisbergcommented, Oct 29, 2020

I went ahead and tested with before mentioned repo:

v1.7.8:

resolveRef: 2.230ms
status: 400.173ms
readObject #1: 294.029ms
readObject #2: 278.865ms
total run #1: 981.091ms

resolveRef: 1.959ms
status: 231.133ms
readObject #1: 254.164ms
readObject #2: 254.196ms
total run #2: 742.023ms

resolveRef: 2.117ms
status: 230.299ms
readObject #1: 229.716ms
readObject #2: 275.966ms
total run #3: 738.623ms

resolveRef: 2.010ms
status: 231.274ms
readObject #1: 228.124ms
readObject #2: 239.396ms
total run #4: 701.301ms

resolveRef: 1.771ms
status: 241.533ms
readObject #1: 223.004ms
readObject #2: 236.289ms
total run #5: 703.025ms

exposed cache param:

resolveRef: 2.162ms
status: 352.665ms
readObject #1: 2.634ms
readObject #2: 1.923ms
total run #1: 364.962ms

resolveRef: 0.599ms
status: 2.456ms
readObject #1: 2.215ms
readObject #2: 1.469ms
total run #2: 7.018ms

resolveRef: 0.456ms
status: 1.888ms
readObject #1: 1.503ms
readObject #2: 0.670ms
total run #3: 4.739ms

resolveRef: 0.443ms
status: 2.021ms
readObject #1: 1.281ms
readObject #2: 0.485ms
total run #4: 4.443ms

resolveRef: 0.454ms
status: 1.675ms
readObject #1: 1.213ms
readObject #2: 4.168ms
total run #5: 7.717ms

It’s roughly a 100x improvement.

0reactions
stefan-guggisbergcommented, Nov 9, 2020

Thank you very much, @wmhilton. That solved our performance issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Server very slow for certain repositories · Issue #233 - GitHub
7.5 introduced a regression which causes a massive performance degradation in git-server : requests to non-existing files ( 404 ) are now ~20- ......
Read more >
Massive Performance Degradation On Statistics For Large ...
Massive Performance Degradation On Statistics For Large Partitioned Tables After Upgrade To 19c (Doc ID 2611336.1) · Applies to: · Symptoms.
Read more >
Detect and Resolve Performance Issues - Mendix Docs
Describes possible performance issues with root causes and resolutions.
Read more >
Server having massive Memory(RAM) issues. Memory Leak?
The memory usage would just slowly creep up, idling at 7.5GB with 0-3 players after startup, and would occasionally shoot up 1GB or...
Read more >
Comparison Between Bare-metal, Container and VM using ...
➢ Compared to Baremetal, the performance of VM degrades significantly to 30%. (In synthetic data, it is 20%). ➢ VM suffers from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found