You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any idea why simple-git is so much faster than execa than execFile? Effectively it should be about the same, albeit of course spawning a process will always be slower than a native library. Also isomorphic.. I guess the first time V8 JIT compiler will take a lot of time, but it's still consistently slower over many calls?
Also anyone ever tried to compile canonical git using emscripten to webassembly? I wonder how that one compares in benchmarks.
But also not reassuring for production use, considering no one there can actually fix it.
PS: I tried to compile canonical git with emscripten.. it compiles, and kinda works, but also doesnt with lots of tiny and issues due to the file system simulation, but eventually guess it was a stupid idea, because it's forced to use sync io and there is no way around that.
Activity
loynoir commentedon Apr 5, 2023
Done.
https://github.com/loynoir/git-bench/blob/main/bench.txt
axkibe commentedon Apr 7, 2023
Any idea why simple-git is so much faster than execa than execFile? Effectively it should be about the same, albeit of course spawning a process will always be slower than a native library. Also isomorphic.. I guess the first time V8 JIT compiler will take a lot of time, but it's still consistently slower over many calls?
Also anyone ever tried to compile canonical git using emscripten to webassembly? I wonder how that one compares in benchmarks.
loynoir commentedon Apr 8, 2023
@axkibe
You remind me to test whether
/tmpis tmpfs, and found devcontainer/tmpis not tmpfs.Now I
/tmpand/tmpis tmpfsisomorphic-gitencounter bug 1163, and remove from benchhttps://github.com/loynoir/git-bench/blob/733d6b7c7b3bae9f5655396b023e2889b302a4ae/bench.txt#L1-L8
Seems
simpleGitis still a bit faster.Have not look into
simpleGitcode, I guess raw git command parse config every time, andsimpleGitsomehow cache config.Just a reminder, if you want to use
simpleGit,simpleGit_show()return string if I remember correctly, the otherXXX_show()return Buffer.sosuisen commentedon Apr 8, 2023
@axkibe
I have found a wasm version of libgit2, though not the canonical git.
I have not yet examined it closely, but I feel it is promising.
https://github.com/petersalomonsen/wasm-git
axkibe commentedon Apr 8, 2023
Out of some reason, isogit is not looking for the commit object in the pack file, this "fixes" it as workaround in berry:
mv .git/objects/pack/pack-5594355c4b021332ab59e14ea79d5c46bf10ec68.pack .
git unpack-objects < pack-5594355c4b021332ab59e14ea79d5c46bf10ec68.pack
of course not a really fix, but it can run the test:
But also not reassuring for production use, considering no one there can actually fix it.
PS: I tried to compile canonical git with emscripten.. it compiles, and kinda works, but also doesnt with lots of tiny and issues due to the file system simulation, but eventually guess it was a stupid idea, because it's forced to use sync io and there is no way around that.