Repository navigation
feat: move gitIgnore loading into dagOp - #10853
Conversation
Optimize performances by moving the gitIgnore loading into a dagOpWrapper internal operation so it's cached more efficiently. Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
|
As asked by @helderco, I also did some benchmark specially on how long it takes to load the modules git ignore: Code snippet start := time.Now()
// Load .gitignore patterns before loading the module so they can be used in the `Include` argument
// instead of Exclude so we get the right behaviour.
// We only include the .gitignore from the module source path and above up to the context directory.
ignorePatterns, err := loadDirectoryGitIgnorePatterns(ctx, src.Local.ContextDirectoryPath, filepath.Join(src.Local.ContextDirectoryPath, moduleSourcePath))
if err != nil {
return fmt.Errorf("failed to load .gitignore patterns: %w", err)
}
rebasedIgnorePatterns, err := rebaseGitIgnorePatterns(src.Local.ContextDirectoryPath, src.Local.ContextDirectoryPath, ignorePatterns)
if err != nil {
return fmt.Errorf("failed to rebase .gitignore patterns: %w", err)
}
end := time.Since(start)
slog.Debug("moduleSource .gitignore patterns", "duration", end.String(), "duration_ms", end.Milliseconds(), "duration_seconds", end.Seconds(), "duration_ns", end.Nanoseconds())
|
|
Hmmm... how is 1000 .gitignore better than our dagger/dagger? I suggest you run something like |
My theory is that the time it takes to get the cache is slower on dagger than for 1000 .gitignore that are not in nested directories. I'll do some benchmark specially inside gitIgnoreFor to see what we got |
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
Signed-off-by: Tom Chauveau <[email protected]>
This reverts commit ea5f91d.
This reverts commit ea5f91d. Signed-off-by: Justin Chadwell <[email protected]>
This reverts commit ea5f91d. Signed-off-by: Justin Chadwell <[email protected]>
Optimize performances by moving the gitIgnore loading into a dagOpWrapper internal operation so it's cached more efficiently. Remove multiple selection in favor on walkdir Fix host | directory . issue on rebase pattern Signed-off-by: Tom Chauveau <[email protected]>
Optimize performances by moving the gitIgnore loading into a dagOpWrapper internal operation so it's cached more efficiently. Remove multiple selection in favor on walkdir Fix host | directory . issue on rebase pattern Signed-off-by: Tom Chauveau <[email protected]>


Optimize performances by moving the gitIgnore loading into a dagOpWrapper internal operation so it's cached
more efficiently.
Also removed the dag.Select to read file in favour of a mount + fs.Walkdir.
This PR follows up #10736 and apply this comment: #10736 (comment)
Benchmarks
Specific load git ignore benchmark: #10853 (comment)
GitIgnoreFor specific benchmarks: #10853 (comment)