Open stroiman opened 2 weeks ago
hey thanks for this and for including a reproducer. That’s fantastic! i’ll dig in and take a look - I’m perpetually annoyed at the performance difference between the ginkgo
cli and go test
. the only difference is that the ginkgo
cli (for reasons that still make sense) first runs go test -c
to compile the binary and then invokes it.
but you may be bumping into something to do with how ginkgo
walks the directory structure to find test suites. i’ll dig in and let you know, but it might be a bit before I get back to you.
Hey, I made another observation; which does seem to support the idea that there's something about walking the directory structure/dependency analyses.
I restructured my code, so right now the root has no code, but there are two folder, browser/
, which is the DOM implementation and parser, and scripting/
which hosts the v8 engine. scripting
has a dependency to browser
.
This was mostly done, as the v8 added some delay, so I wanted to just separate the code; so I could dive into one part of the system and run test tests with no unnecessary dependencies.
But my observation is that when I run ginkgo watch -r
from the root folder, the whole process hangs
Identified 2 test suites. Locating dependencies to a depth of 1 (this may take a while)...
Watching 2 suites:
./browser [0 dependencies]
./scripting [0 dependencies]
When going into one of the subfolders, there is some delay to the initial startup, but it doesn't hang.
commit where this behavior is observed: https://github.com/stroiman/go-dom/commit/5368cf1cad0dd193113e0979371fadd41cb42232
This is a resurrection of #644 from 4 years ago, which was closed, as far as I could tell, due to lack of input on reproducability? An automated message suggested a new issue, rather than commenting on the old.
I got the same issue in my small project (so far it's small)
My small hobby project was to build a headless browser. But when I added the v8 engine to my project, I noticed a significant delay added to my TDD loop.
Then comparing with
go test
, I saw an approximately x2 execution time increase.So the primary diff is about ~1 sec of user time, and as visible, it's not test execution time, which is 9millisconds.
This is measured on MacOS, on a MacBook M2 Max
Setting the
-compilers
or--compilers
to any value doesn't have any significant effect.My project is here: https://github.com/stroiman/go-dom
The main branch doesn't include v8 - it's in the branch
embed-v8-engine
. Main branch is still slower (about x2), but it wasn't until I added v8 that I felt the delay was becoming annoying.But I noticed something else
Features were missing from v8go, so I use an experimental branch of my own fork of the v8go project; and has a result, I have a
replace
directive in thego.mod
file to point to my version. While working on those features on v8go, it would point to a local folder:So, in short, my directory structure is
When I would run
ginkgo watch -r
fromgo/src/github/stroiman/go-dom
it would actually detect when I made modifications to files in v8go. So not only files in a subfolder, but subfolders of a siblingWhile this was really helpful while working on the v8go code, it doesn't seem like it should do that? That
-r
should only look in subfolders.So this could indicate that ginkgo is looking at too many directories?