Git Product home page Git Product logo

Comments (9)

jcubic avatar jcubic commented on May 28, 2024 1

I don't think that we can do anything to make it faster. This is the limitation of NodeJS and FS. NodeGit uses libgit library that is written in C, that's why it's probably faster.

But if you want to contribute and increase the performance of the library you're welcome to do so.

from isomorphic-git.

scolladon avatar scolladon commented on May 28, 2024 1

Hi @zFitness

I also experienced slow performance with huge repository.
After profiling the lib with my implementation it seemed the issue was located inside a small function massively called.
The fix has been integrated in v1.25.3.

Could you retry and see if it also fixed your use case ?

from isomorphic-git.

zFitness avatar zFitness commented on May 28, 2024 1

Hi @zFitness

I also experienced slow performance with huge repository. After profiling the lib with my implementation it seemed the issue was located inside a small function massively called. The fix has been integrated in v1.25.3.

Could you retry and see if it also fixed your use case ?您可以重试并看看它是否也修复了您的用例吗?关闭

Maybe it's a little fast, but it is faster to use the cache parameter

    ✓ isomorphic-git-cache (835 ms)
    ✓ isomorphic-git (12870 ms)

from isomorphic-git.

zFitness avatar zFitness commented on May 28, 2024
    ✓ isomorphic-git (13353 ms)
    ✓ node-git (132 ms)
    ✓ fs (51 ms)
    ✓ child_process (11518 ms)

from isomorphic-git.

zFitness avatar zFitness commented on May 28, 2024

Seems to be slower than child_process + git.

from isomorphic-git.

zFitness avatar zFitness commented on May 28, 2024

I don't think that we can do anything to make it faster. This is the limitation of NodeJS and FS. NodeGit uses libgit library that is written in C, that's why it's probably faster.

我认为我们无法采取任何措施来加快速度。这是 NodeJS 和 FS 的限制。 NodeGit 使用用 C 编写的 libgit 库,这就是它可能更快的原因。关闭

But if you want to contribute and increase the performance of the library you're welcome to do so.

ok, thanks

from isomorphic-git.

zFitness avatar zFitness commented on May 28, 2024

I don't think that we can do anything to make it faster. This is the limitation of NodeJS and FS. NodeGit uses libgit library that is written in C, that's why it's probably faster.

But if you want to contribute and increase the performance of the library you're welcome to do so.

Hello, I found that the cache parameter can improve the speed

await git1.readBlob({
        fs: fs,
        dir: projectDir,
        oid,
        cache,
        filepath: file.replace(projectDir, ""),
      });

Now, I implemented an exists function to determine whether files and directories exist under a branch.
Please optimize it for me.Thanks @jcubic

      exists: async (path: string) => {
        try {
          await git.readBlob({
            fs: fs,
            dir: this.gitBasePath,
            oid,
            filepath: path.replace(this.gitBasePath, "").replace(/^\//, ""),
          });
          return true;
        } catch (e) {
          try {
            await git.readTree({
              fs: fs,
              dir: this.gitBasePath,
              oid,
              filepath: path.replace(this.gitBasePath, "").replace(/^\//, ""),
            });
            return true;
          } catch (e) {
            return false;
          }
        }
      },

from isomorphic-git.

zFitness avatar zFitness commented on May 28, 2024

Hi @zFitness

I also experienced slow performance with huge repository. After profiling the lib with my implementation it seemed the issue was located inside a small function massively called. The fix has been integrated in v1.25.3.

Could you retry and see if it also fixed your use case ?您可以重试并看看它是否也修复了您的用例吗?关闭

ok, i will retry

from isomorphic-git.

scolladon avatar scolladon commented on May 28, 2024

Nice, it probably means your use case was not dependent to the fix.
Cache works pretty well for you !

from isomorphic-git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.