Thread (6 messages) 6 messages, 3 authors, 2022-10-21

Re: "submodule foreach" much slower than removed "submodule--helper --list"

From: Jeff King <hidden>
Date: 2022-10-17 17:46:28

On Mon, Oct 17, 2022 at 06:50:06PM +0200, Ævar Arnfjörð Bjarmason wrote:
Sorry about the slowdown, the removal of "list" was just an in-between
step to migrating "submodule" to a full built-in.

I can't reproduce anything like the 8ms v.s. ~600ms difference you note
here, but for me migrating it to a built-in is around 10% slower with
"foreach" than the old "list". I wonder what results you get?
I don't think "foreach" can ever be as performant as a bare "list". It
inherently is going to do O(n) fork+execs. So it's OK if you have one or
two submodules, but not if you have hundreds.

If it treated "echo" as a builtin and served it in-process, it could
avoid that extra overhead. But there are so many corner cases there,
you'd probably do better to add "list --format" instead.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help