isomorphic-git: Browser freezing when cloning big repo

We discuss on gitter with @burningTyger about perfomence of Big repos, his was not working in electron (20MB) and mine was freezing (15MB) the browser tab (right click was not working) before I get message:

Counting objects: 12462, done.
Compressing objects: 100% (24/24), done.
Total 12462 (delta 28), reused 28 (delta 17), pack-reused 12421

next I’ve needed to wait a bit, but at least I could open dev tools and pause the script. It was not possible before emitter send messages. And the clone was successful (I’m using full clone right now).

the version is from unpkg.org CDN with 0.x.x

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

\r at the beginning of the message would be as good as parameter I could just use:

if (message[0] == '\r') {
    term.update(message);
} else {
   term.echo(message);
}

also I can add feature to jQuery Terminal that if string have \r at the beginning and no \n it will update last line, didn’t thought about this.

but I think that I can live without this feature, I can just use:

function makeEmitter() {
  var emitter = new EventEmitter();
  var prev;
  emitter.on('message', function(message) {
    if (message.replace(/[0-9%]+/g, '') === prev) {
       term.update(message);
    } else {
       term.echo(message);
    }
    prev = message;
  });
  return emitter;
}

the same with new API I will use:

core.events.on('*:message', (message) => {
   // same code
});

Web worker is much easier to manage then service worker.

I’ve often had luck shimming window in a worker. Something like this

window = self
importScript('https://unpkg.com/isomorphic-git@0.19.6/dist/bundle.umd.min.js')

would probably work. If not, making an official Worker wrapper is coming up on my todo list anyway. 😃

By coincidence, I discovered #294 today which would also speed up cloning tremendously.