Skip to content

Commit 3e50144

Browse files
committed
Merge branch 'master' of github.com:busy-spin/quickfixj into bugfix/issue-576-perf-regression
2 parents 4b63804 + 351154a commit 3e50144

File tree

31 files changed

+522
-82
lines changed

31 files changed

+522
-82
lines changed

.github/workflows/maven.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
1515
matrix:
16-
os: [ubuntu-latest, macOS-latest]
16+
os: [ubuntu-latest, macOS-13]
1717
java: [8, 11, 17]
1818
fail-fast: false
1919
max-parallel: 4
@@ -28,7 +28,7 @@ jobs:
2828
java-version: ${{ matrix.java }}
2929
cache: 'maven'
3030
- name: Test with Maven
31-
run: ./mvnw install -B -V -Pminimal-fix-latest -D"java.util.logging.config.file"="logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"
31+
run: ./mvnw install -B -V -Pminimal-fix-latest -D"java.util.logging.config.file"="./quickfixj-core/src/test/resources/logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"
3232

3333
test-windows:
3434
runs-on: ${{ matrix.os }}
@@ -43,7 +43,7 @@ jobs:
4343
steps:
4444
- uses: actions/checkout@v4
4545
- name: Configure pagefile
46-
uses: al-cheb/configure-pagefile-action@v1.3
46+
uses: al-cheb/configure-pagefile-action@v1.4
4747
with:
4848
minimum-size: 8GB
4949
maximum-size: 16GB
@@ -55,4 +55,4 @@ jobs:
5555
java-version: ${{ matrix.java }}
5656
cache: 'maven'
5757
- name: Test with Maven on Windows
58-
run: ./mvnw.cmd install -B -V -D"maven.javadoc.skip"="true" -P"skipBundlePlugin,minimal-fix-latest" -D"java.util.logging.config.file"="logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"
58+
run: ./mvnw.cmd install -B -V -D"maven.javadoc.skip"="true" -P"skipBundlePlugin,minimal-fix-latest" -D"java.util.logging.config.file"="./quickfixj-core/src/test/resources/logging.properties" -D"http.keepAlive"="false" -D"maven.wagon.http.pool"="false" -D"maven.wagon.httpconnectionManager.ttlSeconds"="120"

pom.xml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,48 +69,48 @@
6969
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
7070
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
7171
<jdkLevel>1.8</jdkLevel>
72-
<jmh.version>1.36</jmh.version>
73-
<slf4j.version>2.0.10</slf4j.version>
72+
<slf4j.version>2.0.13</slf4j.version>
7473
<mockito-core.version>4.11.0</mockito-core.version>
7574
<hamcrest.version>2.2</hamcrest.version>
76-
<junit.jupiter.version>5.10.1</junit.jupiter.version>
75+
<junit.jupiter.version>5.10.2</junit.jupiter.version>
7776
<maven.compiler.source>8</maven.compiler.source>
7877
<maven.compiler.target>8</maven.compiler.target>
7978
<mainClass/>
8079
<maven.version>3.8.7</maven.version>
8180
<maven-libs-version>3.9.6</maven-libs-version>
8281
<maven-plugin-api-version>3.9.6</maven-plugin-api-version>
8382
<maven-resources-plugin-version>3.3.1</maven-resources-plugin-version>
84-
<maven-compiler-plugin-version>3.12.1</maven-compiler-plugin-version>
85-
<maven-jar-plugin-version>3.3.0</maven-jar-plugin-version>
86-
<maven-surefire-plugin-version>3.2.3</maven-surefire-plugin-version>
87-
<maven-pmd-plugin-version>3.21.2</maven-pmd-plugin-version>
88-
<maven-source-plugin-version>3.3.0</maven-source-plugin-version>
83+
<maven-compiler-plugin-version>3.13.0</maven-compiler-plugin-version>
84+
<maven-jar-plugin-version>3.4.1</maven-jar-plugin-version>
85+
<maven-surefire-plugin-version>3.2.5</maven-surefire-plugin-version>
86+
<maven-pmd-plugin-version>3.22.0</maven-pmd-plugin-version>
87+
<maven-source-plugin-version>3.3.1</maven-source-plugin-version>
8988
<maven-javadoc-plugin-version>3.6.3</maven-javadoc-plugin-version>
90-
<maven-shade-plugin-version>3.5.1</maven-shade-plugin-version>
91-
<maven-assembly-plugin-version>3.6.0</maven-assembly-plugin-version>
89+
<maven-shade-plugin-version>3.5.3</maven-shade-plugin-version>
90+
<maven-assembly-plugin-version>3.7.1</maven-assembly-plugin-version>
9291
<maven-bundle-plugin-version>5.1.9</maven-bundle-plugin-version>
93-
<maven-gpg-plugin-version>3.1.0</maven-gpg-plugin-version>
94-
<maven-deploy-plugin-version>3.1.1</maven-deploy-plugin-version>
92+
<maven-gpg-plugin-version>3.2.4</maven-gpg-plugin-version>
93+
<maven-deploy-plugin-version>3.1.2</maven-deploy-plugin-version>
9594
<nexus-staging-maven-plugin-version>1.6.13</nexus-staging-maven-plugin-version>
96-
<build-helper-maven-plugin-version>3.5.0</build-helper-maven-plugin-version>
95+
<build-helper-maven-plugin-version>3.6.0</build-helper-maven-plugin-version>
9796
<maven-shared-utils.version>3.4.2</maven-shared-utils.version>
9897
<file-management.version>3.0.0</file-management.version>
99-
<maven-plugin-annotations.version>3.10.2</maven-plugin-annotations.version>
98+
<maven-plugin-annotations.version>3.13.0</maven-plugin-annotations.version>
10099
<maven-plugin-testing-harness.version>3.3.0</maven-plugin-testing-harness.version>
101100
<plantuml-maven-plugin-version>1.2</plantuml-maven-plugin-version>
102101
<plantuml-version>8059</plantuml-version>
103102
<xml-maven-plugin-version>1.1.0</xml-maven-plugin-version>
104103
<fix-orchestra.standard.version>1.5.4</fix-orchestra.standard.version>
105104
<fix-orchestra.repository.version>1.7.3</fix-orchestra.repository.version>
106105
<docgen.version>1.6.8</docgen.version>
107-
<jaxb.version>4.0.1</jaxb.version>
106+
<jaxb.version>4.0.2</jaxb.version>
108107
<apache.mina.version>2.2.3</apache.mina.version>
109-
<commons.io.version>2.15.1</commons.io.version>
108+
<commons.io.version>2.16.1</commons.io.version>
110109
<orchestra.file>OrchestraFIXLatest.xml</orchestra.file>
111110
<org.quickfixj.orchestra.tools.version>1.0.2</org.quickfixj.orchestra.tools.version>
112111
<proxool.version>0.9.1</proxool.version>
113112
<jaxen.version>2.0.0</jaxen.version>
113+
<jmh.version>1.36</jmh.version>
114114
</properties>
115115

116116
<dependencyManagement>
@@ -226,12 +226,12 @@
226226
<dependency>
227227
<groupId>org.codehaus.plexus</groupId>
228228
<artifactId>plexus-utils</artifactId>
229-
<version>4.0.0</version>
229+
<version>4.0.1</version>
230230
</dependency>
231231
<dependency>
232232
<groupId>org.codehaus.plexus</groupId>
233233
<artifactId>plexus-xml</artifactId>
234-
<version>4.0.3</version>
234+
<version>4.0.4</version>
235235
</dependency>
236236
<dependency>
237237
<groupId>com.sleepycat</groupId>
@@ -465,15 +465,15 @@
465465
</plugin>
466466
<plugin>
467467
<artifactId>maven-invoker-plugin</artifactId>
468-
<version>3.6.0</version>
468+
<version>3.6.1</version>
469469
</plugin>
470470
<plugin>
471471
<artifactId>maven-plugin-plugin</artifactId>
472-
<version>3.10.2</version>
472+
<version>3.13.0</version>
473473
</plugin>
474474
<plugin>
475475
<artifactId>maven-install-plugin</artifactId>
476-
<version>3.1.1</version>
476+
<version>3.1.2</version>
477477
</plugin>
478478
<plugin>
479479
<artifactId>maven-clean-plugin</artifactId>

quickfixj-base/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
</plugin>
230230
<plugin>
231231
<artifactId>maven-jxr-plugin</artifactId>
232-
<version>3.3.1</version>
232+
<version>3.3.2</version>
233233
</plugin>
234234
</plugins>
235235
</reporting>

quickfixj-base/src/main/java/quickfix/FixVersions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public interface FixVersions {
3030
String BEGINSTRING_FIX44 = "FIX.4.4";
3131

3232
/*
33-
* FIX 5.0+ does not have a begin string.
33+
* FIX 5.0+ does not have a BeginString.
3434
*/
3535
String FIX50 = "FIX.5.0";
3636
String FIX50SP1 = "FIX.5.0SP1";

quickfixj-base/src/main/java/quickfix/InvalidMessage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
package quickfix;
2121

22-
/*
23-
* An exception when a message is not valid according to the
22+
/**
23+
* Thrown when a message is not valid according to the
2424
* basic message validation or the data dictionary.
2525
*/
2626
public class InvalidMessage extends Exception {

quickfixj-base/src/main/java/quickfix/MessageUtils.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ public static Message parse(MessageFactory messageFactory, DataDictionary dataDi
101101
* @param messageFactory
102102
* @param dataDictionary
103103
* @param messageString
104+
* @param validateChecksum
104105
* @return the parsed message
105106
* @throws InvalidMessage
106107
*/
@@ -129,6 +130,10 @@ public static boolean isLogon(String message) {
129130
return isMessageType(message, MsgType.LOGON);
130131
}
131132

133+
public static boolean isLogonMsgType(String msgType) {
134+
return MsgType.LOGON.equals(msgType);
135+
}
136+
132137
private static boolean isMessageType(String message, String msgType) {
133138
try {
134139
return msgType.equals(getMessageType(message));
@@ -208,10 +213,10 @@ public static String getStringField(String messageString, int tag) {
208213
};
209214

210215
/**
211-
* Convert an ApplVerID to a "begin string"
216+
* Convert an ApplVerID to a BeginString.
212217
*
213218
* @param applVerID
214-
* @return the begin string for the specified ApplVerID.
219+
* @return the BeginString for the specified ApplVerID.
215220
* @throws QFJException if conversion fails.
216221
* @see ApplVerID
217222
*/
@@ -239,10 +244,10 @@ public static String toBeginString(ApplVerID applVerID) throws QFJException {
239244
};
240245

241246
/**
242-
* Convert a begin string to an ApplVerID
247+
* Convert a BeginString to an ApplVerID.
243248
*
244249
* @param beginString
245-
* @return the ApplVerID for the specified begin string.
250+
* @return the ApplVerID for the specified BeginString.
246251
* @throws QFJException if conversion fails.
247252
* @see FixVersions
248253
*/

quickfixj-codegenerator/pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@
7878
</plugin>
7979
<plugin>
8080
<artifactId>maven-plugin-plugin</artifactId>
81-
<version>3.10.2</version>
81+
<version>3.13.0</version>
82+
<configuration>
83+
<goalPrefix>quickfixj-codegenerator</goalPrefix>
84+
</configuration>
8285
</plugin>
8386
</plugins>
8487
</build>

quickfixj-core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@
234234
<plugin>
235235
<groupId>org.apache.maven.plugins</groupId>
236236
<artifactId>maven-jxr-plugin</artifactId>
237-
<version>3.3.1</version>
237+
<version>3.3.2</version>
238238
</plugin>
239239
</plugins>
240240
</reporting>

quickfixj-core/src/main/java/quickfix/CachedFileStore.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ public Date getCreationTime() throws IOException {
162162
return cache.getCreationTime();
163163
}
164164

165+
/*
166+
* (non-Javadoc)
167+
* @see quickfix.MessageStore#getCreationTimeCalendar()
168+
*/
169+
public Calendar getCreationTimeCalendar() throws IOException {
170+
return cache.getCreationTimeCalendar();
171+
}
172+
165173
private void initializeSequenceNumbers() throws IOException {
166174
sequenceNumberFile.seek(0);
167175
if (sequenceNumberFile.length() > 0) {

quickfixj-core/src/main/java/quickfix/DefaultSessionSchedule.java

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,17 @@ public class DefaultSessionSchedule implements SessionSchedule {
4141
private final int[] weekdayOffsets;
4242
protected static final Logger LOG = LoggerFactory.getLogger(DefaultSessionSchedule.class);
4343

44+
//Cache recent time data to reduce creation of calendar objects
45+
private final ThreadLocal<Calendar> threadLocalCalendar;
46+
private final ThreadLocal<TimeInterval> threadLocalRecentTimeInterval;
47+
4448
public DefaultSessionSchedule(SessionSettings settings, SessionID sessionID) throws ConfigError,
4549
FieldConvertError {
50+
threadLocalCalendar = ThreadLocal.withInitial(SystemTime::getUtcCalendar);
51+
threadLocalRecentTimeInterval = new ThreadLocal<>();
52+
isNonStopSession = settings.isSetting(sessionID, Session.SETTING_NON_STOP_SESSION)
53+
&& settings.getBool(sessionID, Session.SETTING_NON_STOP_SESSION);
4654

47-
isNonStopSession = settings.isSetting(sessionID, Session.SETTING_NON_STOP_SESSION) && settings.getBool(sessionID, Session.SETTING_NON_STOP_SESSION);
4855
TimeZone defaultTimeZone = getDefaultTimeZone(settings, sessionID);
4956
if (isNonStopSession) {
5057
isWeekdaySession = false;
@@ -104,7 +111,7 @@ private TimeEndPoint getTimeEndPoint(SessionSettings settings, SessionID session
104111
}
105112

106113
private TimeZone getDefaultTimeZone(SessionSettings settings, SessionID sessionID)
107-
throws ConfigError, FieldConvertError {
114+
throws ConfigError {
108115
TimeZone sessionTimeZone;
109116
if (settings.isSetting(sessionID, Session.SETTING_TIMEZONE)) {
110117
String sessionTimeZoneID = settings.getString(sessionID, Session.SETTING_TIMEZONE);
@@ -300,9 +307,16 @@ public boolean isSessionTime() {
300307
if(isNonStopSession()) {
301308
return true;
302309
}
303-
Calendar now = SystemTime.getUtcCalendar();
304-
TimeInterval interval = theMostRecentIntervalBefore(now);
305-
return interval.isContainingTime(now);
310+
Calendar now = threadLocalCalendar.get();
311+
now.setTimeInMillis(SystemTime.currentTimeMillis());
312+
TimeInterval mostRecentInterval = threadLocalRecentTimeInterval.get();
313+
if (mostRecentInterval != null && mostRecentInterval.isContainingTime(now)) {
314+
return true;
315+
}
316+
mostRecentInterval = theMostRecentIntervalBefore(now);
317+
boolean result = mostRecentInterval.isContainingTime(now);
318+
threadLocalRecentTimeInterval.set(mostRecentInterval);
319+
return result;
306320
}
307321

308322
public String toString() {

0 commit comments

Comments
 (0)