Re: svn commit: r276423 - stable/10/share/mk

2015-01-26 Thread Garrett Cooper
On Dec 31, 2014, at 7:54, Julio Merino  wrote:

> On Dec 30, 2014, at 21:46, Garrett Cooper  wrote:
> 
>> Author: ngie
>> Date: Tue Dec 30 20:46:01 2014
>> New Revision: 276423
>> URL: https://svnweb.freebsd.org/changeset/base/276423
>> 
>> Log:
>> MFC r274077:
>> 
>>   As an optimization (in simple, well used cases) only call cat ${.ALLSRC} 
>> when
>>   generating files from various sources instead of calling cat ${.ALLSRC} | 
>> sed
> 
> Is there any visible effect to this optimization?  Otherwise, the extra 
> complexity does not seem warranted.

Hi Julio!

There are a few things to gain from this:
1. Errors with cat’ing the files are caught when sed transformations aren’t 
applied to the files.
2. Less resources are used in generating the files if sed isn’t needed:
i. Less forked processes.
ii. No pipelines need to be created.
I don’t have numbers for how much faster it is (probably negligible if done 
once, potentially more noticeable if done as a micro benchmark), but I could do 
this if you like.

Thank you!


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: svn commit: r276423 - stable/10/share/mk

2014-12-31 Thread Julio Merino
On Dec 30, 2014, at 21:46, Garrett Cooper  wrote:

> Author: ngie
> Date: Tue Dec 30 20:46:01 2014
> New Revision: 276423
> URL: https://svnweb.freebsd.org/changeset/base/276423
> 
> Log:
>  MFC r274077:
> 
>As an optimization (in simple, well used cases) only call cat ${.ALLSRC} 
> when
>generating files from various sources instead of calling cat ${.ALLSRC} | 
> sed

Is there any visible effect to this optimization?  Otherwise, the extra 
complexity does not seem warranted.
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r276423 - stable/10/share/mk

2014-12-30 Thread Garrett Cooper
Author: ngie
Date: Tue Dec 30 20:46:01 2014
New Revision: 276423
URL: https://svnweb.freebsd.org/changeset/base/276423

Log:
  MFC r274077:
  
As an optimization (in simple, well used cases) only call cat ${.ALLSRC} 
when
generating files from various sources instead of calling cat ${.ALLSRC} | 
sed
  
The perl case was skipped because it's not being used in the tree at this 
time

Modified:
  stable/10/share/mk/atf.test.mk
  stable/10/share/mk/plain.test.mk
  stable/10/share/mk/tap.test.mk
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/share/mk/atf.test.mk
==
--- stable/10/share/mk/atf.test.mk  Tue Dec 30 20:44:05 2014
(r276422)
+++ stable/10/share/mk/atf.test.mk  Tue Dec 30 20:46:01 2014
(r276423)
@@ -105,8 +105,12 @@ ATF_TESTS_SH_SED_${_T}?= # empty
 ATF_TESTS_SH_SRC_${_T}?= ${_T}.sh
 ${_T}: ${ATF_TESTS_SH_SRC_${_T}}
echo '#! /usr/libexec/atf-sh' > ${.TARGET}.tmp
+.if empty(ATF_TESTS_SH_SED_${_T})
+   cat ${.ALLSRC:N*Makefile*} >>${.TARGET}.tmp
+.else
cat ${.ALLSRC:N*Makefile*} \
| sed ${ATF_TESTS_SH_SED_${_T}} >>${.TARGET}.tmp
+.endif
chmod +x ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
 .endfor

Modified: stable/10/share/mk/plain.test.mk
==
--- stable/10/share/mk/plain.test.mkTue Dec 30 20:44:05 2014
(r276422)
+++ stable/10/share/mk/plain.test.mkTue Dec 30 20:46:01 2014
(r276423)
@@ -57,8 +57,12 @@ CLEANFILES+= ${_T} ${_T}.tmp
 PLAIN_TESTS_SH_SED_${_T}?= # empty
 PLAIN_TESTS_SH_SRC_${_T}?= ${_T}.sh
 ${_T}: ${PLAIN_TESTS_SH_SRC_${_T}}
+.if empty(PLAIN_TESTS_SH_SED_${_T})
+   cat ${.ALLSRC:N*Makefile*} >${.TARGET}.tmp
+.else
cat ${.ALLSRC:N*Makefile*} \
| sed ${PLAIN_TESTS_SH_SED_${_T}} >${.TARGET}.tmp
+.endif
chmod +x ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
 .endfor

Modified: stable/10/share/mk/tap.test.mk
==
--- stable/10/share/mk/tap.test.mk  Tue Dec 30 20:44:05 2014
(r276422)
+++ stable/10/share/mk/tap.test.mk  Tue Dec 30 20:46:01 2014
(r276423)
@@ -86,7 +86,11 @@ CLEANFILES+= ${_T} ${_T}.tmp
 TAP_TESTS_SH_SED_${_T}?= # empty
 TAP_TESTS_SH_SRC_${_T}?= ${_T}.sh
 ${_T}: ${TAP_TESTS_SH_SRC_${_T}}
+.if empty(TAP_TESTS_SH_SED_${_T})
+   cat ${.ALLSRC} >${.TARGET}.tmp
+.else
cat ${.ALLSRC} | sed ${TAP_TESTS_SH_SED_${_T}} >${.TARGET}.tmp
+.endif
chmod +x ${.TARGET}.tmp
mv ${.TARGET}.tmp ${.TARGET}
 .endfor
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"