Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jmh refactor package #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ hs_err_pid*

## Directory-based project format:
.idea/

# for eclipse
target
.*

# if you remove the above rule, at least ignore the following:

# User-specific stuff:
Expand Down
35 changes: 35 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- Adding and removing operations much faster than ArrayList and LinkedList.
- Searching operations nearly same with ArrayList and way better than LinkedList.

## ORIGINAL (time diff + SystemOut)
```
Adding(1M) Elements (5 Tests Avg.)

Expand All @@ -33,6 +34,40 @@ ArrayList: 4118.2 milliseconds
GlueList: 3320.1 milliseconds

```
## JMH
- Prepare local for JMH : "mvn -e clean install"
- Launch Java Class (containing void main) : com.ertu.collection.jmh.GlueListJMH
- for eclipse developers : 3 tools available in "eclipse-tools" directory (you have to configure "mvn" variable in Eclipse Preferences "String subsitutions" pointing to your maven directory)

```
Run complete. Total time: 00:02:13

Benchmark Mode Cnt Score Error Units
GlueListJMH.test_1_add_500k_linked_list thrpt 5 182,338 ± 32,451 ops/s
GlueListJMH.test_2_add_500k_array_list thrpt 5 214,535 ± 7,479 ops/s
GlueListJMH.test_3_add_500k_glue_list thrpt 5 251,288 ± 14,355 ops/s
GlueListJMH.test_4_add_1m_linked_list thrpt 5 80,549 ± 10,526 ops/s
GlueListJMH.test_5_add_1m_array_list thrpt 5 93,010 ± 4,741 ops/s
GlueListJMH.test_6_add_1m_glue_list thrpt 5 121,447 ± 12,033 ops/s
GlueListJMH.test_7_add_10m_linked_list thrpt 5 2,090 ± 1,890 ops/s
GlueListJMH.test_8_add_10m_array_list thrpt 5 5,713 ± 1,720 ops/s
GlueListJMH.test_9_add_10m_glue_list thrpt 5 9,644 ± 5,810 ops/s
```
```
Run complete. Total time: 00:19:37

Benchmark Mode Cnt Score Error Units
GlueListJMH.test_1_add_500k_linked_list thrpt 50 174,315 ± 8,554 ops/s
GlueListJMH.test_2_add_500k_array_list thrpt 50 207,423 ± 3,637 ops/s
GlueListJMH.test_3_add_500k_glue_list thrpt 50 286,250 ± 5,346 ops/s
GlueListJMH.test_4_add_1m_linked_list thrpt 50 77,277 ± 1,607 ops/s
GlueListJMH.test_5_add_1m_array_list thrpt 50 91,264 ± 3,051 ops/s
GlueListJMH.test_6_add_1m_glue_list thrpt 50 131,970 ± 3,007 ops/s
GlueListJMH.test_7_add_10m_linked_list thrpt 50 2,026 ± 0,195 ops/s
GlueListJMH.test_8_add_10m_array_list thrpt 50 6,085 ± 0,208 ops/s
GlueListJMH.test_9_add_10m_glue_list thrpt 50 8,842 ± 0,360 ops/s
```

#Big-O Algorithm Complexity

```
Expand Down
10 changes: 10 additions & 0 deletions eclipse-tools/1 - eclipse-eclipse.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
</listAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${mvn}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="eclipse:eclipse"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/ertu-collection}"/>
</launchConfiguration>
10 changes: 10 additions & 0 deletions eclipse-tools/2 - JMH preparation.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${workspace}"/>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
</listAttribute>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${mvn}"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="-e clean install"/>
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/ertu-collection}"/>
</launchConfiguration>
12 changes: 12 additions & 0 deletions eclipse-tools/3 - GlueListJMH.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/ertu-collection/src/test/java/com/ertu/collection/jmh/GlueListJMH.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.ertu.collection.jmh.GlueListJMH"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ertu-collection"/>
</launchConfiguration>
Empty file removed listText
Empty file.
23 changes: 20 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,20 @@
<groupId>com.ertu.collection</groupId>
<artifactId>ertu-collection</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
<jmh.version>1.13</jmh.version>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
Expand All @@ -26,7 +32,18 @@
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>${jmh.version}</version>
<scope>test</scope>
</dependency>
</dependencies>


</project>
Loading