Hello,

I looked at Commons Lang, Commons IO, Commons CSV, Commons BCEL, Commons
Crypto, and Commons Text. All of the above do the same duplicate work.

Gary

On Sat, Apr 20, 2024, 11:01 AM Gilles Sadowski <gillese...@gmail.com> wrote:

> Hi.
>
> This commit caught my attention but I've not looked in detail (sorry!).
> I'm wondering whether this addition deserves a discussion here on "dev"
> to reach consensus on how to handle benchmarking code in a uniform
> way across all components.
> For a long time, some components (namely and mainly "Commons
> RNG") have been providing[1] extensive JMH codes (in dedicated
> maven modules) in order to generate benchmark reports.
> This addition seems (?) to duplicate the functionality, under different
> assumptions on how to trigger it.
> Did you look at how the benchmarking functionality is laid out in [RNG]?
> Can't it be generalized to other components, with or without formal
> support in the "main" POM file?  [At first sight, it would seem tidier,
> more
> flexible and more maintainable, to *not* bundle benchmark codes within
> "src/test" (where true unit tests reside)...]
>
> Gilles
>
> [1] Thanks to Alex.
>
> Le sam. 20 avr. 2024 à 16:30, <ggreg...@apache.org> a écrit :
> >
> > This is an automated email from the ASF dual-hosted git repository.
> >
> > ggregory pushed a commit to branch master
> > in repository https://gitbox.apache.org/repos/asf/commons-parent.git
> >
> >
> > The following commit(s) were added to refs/heads/master by this push:
> >      new 9637b97  Facilitate JMH benchmarking from the Maven CLI
> > 9637b97 is described below
> >
> > commit 9637b97c371906c90d958b2b7869a47818ad2e0b
> > Author: Gary Gregory <garydgreg...@gmail.com>
> > AuthorDate: Sat Apr 20 10:28:56 2024 -0400
> >
> >     Facilitate JMH benchmarking from the Maven CLI
> >
> >     - Add profile benchmark for JMH benchmarks
> >     - Add JMH to dependency management section
> > ---
> >  pom.xml                 | 46
> +++++++++++++++++++++++++++++++++++++++++-----
> >  src/changes/changes.xml |  3 +++
> >  2 files changed, 44 insertions(+), 5 deletions(-)
> >
> > diff --git a/pom.xml b/pom.xml
> > index abfe20e..dbb3698 100644
> > --- a/pom.xml
> > +++ b/pom.xml
> > @@ -167,7 +167,7 @@
> >      <!-- Warning: org.apache.felix:maven-bundle-plugin does not yet
> support bndlib 7 -->
> >      <commons.biz.aQute.bndlib.version>6.4.1</commons.biz
> .aQute.bndlib.version>
> >      <commons.junit.version>5.10.2</commons.junit.version>
> > -
> > +    <commons.jmh.version>1.37</commons.jmh.version>
> >      <!--
> >        Note: Maven site plugin 3.5.1 is the latest version but is not a
> direct replacement:
> >
> > @@ -1845,7 +1845,6 @@
> >                 </plugins>
> >           </build>
> >      </profile>
> > -
> >      <profile>
> >           <!-- Java 11 and up -->
> >        <id>java-11-up</id>
> > @@ -1856,7 +1855,6 @@
> >          <commons.checkstyle.version>10.15.0</commons.checkstyle.version>
> >        </properties>
> >      </profile>
> > -
> >      <profile>
> >           <!-- Java 17 and up -->
> >        <id>java-17-up</id>
> > @@ -1870,7 +1868,45 @@
> >          -->
> >        </properties>
> >      </profile>
> > -
> > +    <profile>
> > +      <!-- JMH benchmarking -->
> > +      <id>benchmark</id>
> > +      <properties>
> > +        <skipTests>true</skipTests>
> > +        <benchmark>org.apache</benchmark>
> > +      </properties>
> > +      <build>
> > +        <plugins>
> > +          <plugin>
> > +            <groupId>org.codehaus.mojo</groupId>
> > +            <artifactId>exec-maven-plugin</artifactId>
> > +            <version>3.2.0</version>
> > +            <executions>
> > +              <execution>
> > +                <id>benchmark</id>
> > +                <phase>test</phase>
> > +                <goals>
> > +                  <goal>exec</goal>
> > +                </goals>
> > +                <configuration>
> > +                  <classpathScope>test</classpathScope>
> > +                  <executable>java</executable>
> > +                  <arguments>
> > +                    <argument>-classpath</argument>
> > +                    <classpath/>
> > +                    <argument>org.openjdk.jmh.Main</argument>
> > +                    <argument>-rf</argument>
> > +                    <argument>json</argument>
> > +                    <argument>-rff</argument>
> > +
> <argument>target/jmh-result.${benchmark}.json</argument>
> > +                    <argument>${benchmark}</argument>
> > +                  </arguments>
> > +                </configuration>
> > +              </execution>
> > +            </executions>
> > +          </plugin>
> > +        </plugins>
> > +      </build>
> > +    </profile>
> >    </profiles>
> > -
> >  </project>
> > diff --git a/src/changes/changes.xml b/src/changes/changes.xml
> > index a62cb49..0937e3b 100644
> > --- a/src/changes/changes.xml
> > +++ b/src/changes/changes.xml
> > @@ -58,6 +58,9 @@ The <action> type attribute can be
> add,update,fix,remove.
> >       -->
> >      <body>
> >          <release version="70" date="YYYY-MM-DD" description="Version
> 70: Maintenance and update dependencies">
> > +           <!-- ADD -->
> > +           <action type="add" dev="ggregory" due-to="Gary Gregory">Add
> profile benchmark for JMH benchmarks.</action>
> > +           <action type="add" dev="ggregory" due-to="Gary Gregory">Add
> JMH to dependency management section.</action>
> >             <!-- FIX -->
> >             <action type="fix" dev="ggregory" due-to="Gary Gregory">Set
> Javadoc link to latest Java API LTS version.</action>
> >             <!-- UPDATE -->
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>

Reply via email to