Klemens, Benoit,

rovert@ had noticed that git out of the box uses as many threads as the
system has CUPs. claudio@ had pointed that it is quite bad idea and use an
example that ld.lld with -Wl,--threads=1 reduces the configure time by 15%
and system time by 40%.

So, here the diff which replaces 0 threads to 1 by default where it isn't 1
already, and disabled try to use threads in name-hashing.

Are you ok with it?

Index: devel/git/Makefile
===================================================================
RCS file: /home/cvs/ports/devel/git/Makefile,v
diff -u -p -r1.285 Makefile
--- devel/git/Makefile  15 Mar 2025 16:15:15 -0000      1.285
+++ devel/git/Makefile  7 May 2025 23:19:09 -0000
@@ -3,6 +3,7 @@ COMMENT-svn =   subversion interoperabilit
 COMMENT-x11 =  graphical tools
 
 V =            2.49.0
+REVISION =     0
 DISTNAME =     git-${V}
 CATEGORIES =   devel
 
Index: devel/git/patches/patch-builtin_grep_c
===================================================================
RCS file: devel/git/patches/patch-builtin_grep_c
diff -N devel/git/patches/patch-builtin_grep_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ devel/git/patches/patch-builtin_grep_c      7 May 2025 23:18:23 -0000
@@ -0,0 +1,12 @@
+Index: builtin/grep.c
+--- builtin/grep.c.orig
++++ builtin/grep.c
+@@ -42,7 +42,7 @@ static char const * const grep_usage[] = {
+ 
+ static int recurse_submodules;
+ 
+-static int num_threads;
++static int num_threads = 1;
+ 
+ static pthread_t *threads;
+ 
Index: devel/git/patches/patch-builtin_index-pack_c
===================================================================
RCS file: devel/git/patches/patch-builtin_index-pack_c
diff -N devel/git/patches/patch-builtin_index-pack_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ devel/git/patches/patch-builtin_index-pack_c        7 May 2025 23:18:23 
-0000
@@ -0,0 +1,12 @@
+Index: builtin/index-pack.c
+--- builtin/index-pack.c.orig
++++ builtin/index-pack.c
+@@ -131,7 +131,7 @@ static int nr_ofs_deltas;
+ static int nr_ref_deltas;
+ static int ref_deltas_alloc;
+ static int nr_resolved_deltas;
+-static int nr_threads;
++static int nr_threads = 1;
+ 
+ static int from_stdin;
+ static int strict;
Index: devel/git/patches/patch-builtin_pack-objects_c
===================================================================
RCS file: devel/git/patches/patch-builtin_pack-objects_c
diff -N devel/git/patches/patch-builtin_pack-objects_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ devel/git/patches/patch-builtin_pack-objects_c      7 May 2025 23:18:23 
-0000
@@ -0,0 +1,12 @@
+Index: builtin/pack-objects.c
+--- builtin/pack-objects.c.orig
++++ builtin/pack-objects.c
+@@ -213,7 +213,7 @@ static int progress = 1;
+ static int window = 10;
+ static unsigned long pack_size_limit;
+ static int depth = 50;
+-static int delta_search_threads;
++static int delta_search_threads = 1;
+ static int pack_to_stdout;
+ static int sparse;
+ static int thin;
Index: devel/git/patches/patch-name-hash_c
===================================================================
RCS file: devel/git/patches/patch-name-hash_c
diff -N devel/git/patches/patch-name-hash_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ devel/git/patches/patch-name-hash_c 7 May 2025 23:18:23 -0000
@@ -0,0 +1,12 @@
+Index: name-hash.c
+--- name-hash.c.orig
++++ name-hash.c
+@@ -148,7 +148,7 @@ static int cache_entry_cmp(const void *cmp_data UNUSED
+       return remove ? !(ce1 == ce2) : 0;
+ }
+ 
+-static int lazy_try_threaded = 1;
++static int lazy_try_threaded = 0;
+ static int lazy_nr_dir_threads;
+ 
+ /*


-- 
wbr, Kirill

Reply via email to