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

How to run the performance test? #21

Open
paulwbill opened this issue Apr 26, 2015 · 6 comments
Open

How to run the performance test? #21

paulwbill opened this issue Apr 26, 2015 · 6 comments

Comments

@paulwbill
Copy link

Hi there!

I would like to run the latency tests on our environment. In the website you say that you can parse a FixMessage in 30 nanoseconds. What message is that? And when you say you can transmit a message in 1.5 micros, what library are you using to write the message to the network?

I checked the sources but could not find the performance test class. Any details you can give us about the performance test will be appreciated.

@thompsri
Copy link

I think the test in question is TestTransFix.java (testAvgParseTime), however there's some more work to do around this test as it clears the message after the first of the 50m iterations hence the 30ns result is not quite right. I'd expect the result to be more like 300ns for a parser which frames the message into CharSequences "views" without copying the underlying data and about 1us for a parser which copies the field values

@ashelleyhft
Copy link
Contributor

fmr.setFixBytes(fixMessagesArray[i]); is where it resets the data for each
iteration. Not sure where you are seeing the empty ones. Pls. let me know.

On Thu, May 14, 2015 at 4:52 PM, Richard Thompson [email protected]
wrote:

I think the test in question is TestTransFix.java (testAvgParseTime),
however there's some more work to do around this test as it clears the
message after the first of the 50m iterations hence the 30ns result is not
quite right. I'd expect the result to be more like 300ns for a parser which
frames the message into CharSequences "views" without copying the
underlying data and about 1us for a parser which copies the field values


Reply to this email directly or view it on GitHub
#21 (comment).

@thompsri
Copy link

Looking at the test "net.openhft.fix.include.v42.examples.TestTransFix#testAvgParseTime"

       for (int i = 0; i < runs; i++) {
            fmr.setFixMessage(fm);
            fmr.setFixBytes(byteBufBytes);  <= clears the message on 2nd iteration
            fmr.parseFixMsgBytes();
            counter++;
        }

The second time this loop executes, the code in setFixBytes clears the input message so the remaining iterations just parse an empty message.

  public void setFixBytes( ByteBufferBytes fixMsgBufBytes ) {
        if ( this.fixMsgBytes != null ) {
            this.fixMsgBytes.clear();
        }
        this.fixMsgBytes = fixMsgBufBytes.flip();
    }

@martinstuga
Copy link

Probably it would be nice to implement this benchmark with this project: http://openjdk.java.net/projects/code-tools/jmh/

It really does exhaustive benchmarks as it avoids to run your code in loops to avoid JIT optimisation and and also does an JVM warm-up before run the test it self.

If you see this as a nice stuff to have, just let me know, because I'm available to develop it.

@danielshaya
Copy link

Hello Paulo

TransFix is longer being actively maintained. It has been replaced with
Chronicle-FIX which is our enterprise FIX engine.

In this project we are making extensive use of jmh and can optimize fix
parsing/generation so that we can achieve latencies comfortably sub
micro-second.

Regards
Daniel

On Sun, Dec 27, 2015 at 12:34 AM, Paulo Martins [email protected]
wrote:

Probably it would be nice to implement this benchmark with this project:
http://openjdk.java.net/projects/code-tools/jmh/

It really does exhaustive benchmarks as it avoids to run your code in
loops to avoid JIT optimisation and and also does an JVM warm-up before run
the test it self.

If you see this as a nice stuff to have, I'm available to develop it. So,
please let me know.


Reply to this email directly or view it on GitHub
#21 (comment).

@martinstuga
Copy link

Thank you for your response @danielshaya. Jmh is definitely and I thought it fits well on this project. Happy to see that you're already using it.

All the best,

Paulo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants