FIX 4.4 coding in Java or c++? which is better?

Imported from previous forum

Hi,

any idea coding FIX in java or c++ , which language will provide better performance? or does not matter?

I mean something like the pros and cons of coding in JAVA or C++ especially when upgrading to FIX 4.4

Thank You

Best Regards,
Jason

Hi,

any idea coding FIX in java or c++ , which language will provide better
performance? or does not matter?

I mean something like the pros and cons of coding in JAVA or C++
especially when upgrading to FIX 4.4

Thank You

Best Regards, Jason

my opinion:
since this is not a system programming, java will do better job from scratch since coding in java much easy to write or to read, the code is cleaner.

any people disagree?

I know most of the FIX is written in c/c++…

regards,
Jason

Hello!

I don’t gonna explain the details of difference between java and c++.
Do you wanna write a tricky system driver or a Fix handler?
Do you need a offset based access to the memory?
I guess you’ve caught my advice.
Beyond that java offers you reflection. It comes very handy then you do a mapping on your domain objects. Surely, it’s expensive. But It’s nice as a first step. You can replace it with dynamically generated bytecode in further versions. See asm or whatever similar.
Due to Sun Hotspot JVM and especially to aggressive virtual method injection some java code runs more faster then c++ statically compiled version. Rough picture is that the performance of both implementation is similar.
Java bytecode is secure. You will never face mysterious core dump problem.

The clue is your developer team.

sincerely,
alexandre efremov

Hello,

Thanks for the responding.

I guess basic FIX handler such as client side OMS.

I think java data structure(util package) has better memory management and faster in a way they were implemented compare to c++.

I try to put 1 million unique string(market data) into hashtable for fun and I have no obvious delay accessing the data in java. But, I never did in c++, not sure what happen…

the code for java is “cleaner” than c++.

But, I think you are right, both performance should be close enough. I think most company still using c++ for their FIX engine(not sure).

Thanks for the tips: 2 points

Do you wanna write a tricky system driver or a Fix handler?
Do you need a offset based access to the memory?

I guess this answer my question and most of the manager question too.

Regards,
Jason

Hello,

Thanks for the responding.

I guess basic FIX handler such as client side OMS.

I think java data structure(util package) has better memory management
and faster in a way they were implemented compare to c++.

I try to put 1 million unique string(market data) into hashtable for fun
and I have no obvious delay accessing the data in java. But, I never did
in c++, not sure what happen…

the code for java is “cleaner” than c++.

But, I think you are right, both performance should be close enough. I
think most company still using c++ for their FIX engine(not sure).

Thanks for the tips: 2 points

Do you wanna write a tricky system driver or a Fix handler? Do you need
a offset based access to the memory?

I guess this answer my question and most of the manager question too.

Regards, Jason
I am think C++ will have a better performance than Java do. Program written in C++ is much pure than any other languages, one level up from OS, and also gain more benefits from the robusted support standard library (STL) functions. You may get more base functions from java library, if you are not using pure core java. But I think there will be some over heads.

I prefer C++ solution, if try to do it on a Unix box.

Changpeng Yu
FT Computer Solutions

http://www.eptop.com/FIX/FixExpress.htm

Hello,

Thanks for responding. I do agree with you. I guess C++ definitely is better than java because c++ is more powerful than java(of course, the price is memory leak issue if ever occurred).

I actually compare the time of the STL’s map and java’s hashmap (no multi-threading involve in this case as assumption).

It seems to me java is faster than c++ to look for key or insert a new key/value for it assume we have 300k line of strings which 40% is duplicated(market that collected using bloomberg API in visual c++).
Please correct me if I am wrong in above testing.

We do pay for the overhead for the garbage collection in java…

Anyway, for now, I am doing something basic OMS thing… But, maybe in future I will need the c++ for system driver.

I will use java native to deal with c++ if i ever reach that point.

I guess C++ definitely is more powerful than java.

Regards,
Jason

I am think C++ will have a better performance than Java do. Program
written in C++ is much pure than any other languages, one level up from
OS, and also gain more benefits from the robusted support standard
library (STL) functions. You may get more base functions from java
library, if you are not using pure core java. But I think there will be
some over heads.

I prefer C++ solution, if try to do it on a Unix box.

Changpeng Yu FT Computer Solutions

A Person to Person Business Site

Hello,

Thanks for responding. I do agree with you. I guess C++ definitely is
better than java because c++ is more powerful than java(of course, the
price is memory leak issue if ever occurred).

I actually compare the time of the STL’s map and java’s hashmap (no multi-
threading involve in this case as assumption).

It seems to me java is faster than c++ to look for key or insert a new
key/value for it assume we have 300k line of strings which 40% is
duplicated(market that collected using bloomberg API in visual c++).
Please correct me if I am wrong in above testing.

We do pay for the overhead for the garbage collection in java…

Anyway, for now, I am doing something basic OMS thing… But, maybe in
future I will need the c++ for system driver.

I will use java native to deal with c++ if i ever reach that point.

I guess C++ definitely is more powerful than java.

Regards, Jason

I am think C++ will have a better performance than Java do. Program
written in C++ is much pure than any other languages, one level up
from OS, and also gain more benefits from the robusted support
standard library (STL) functions. You may get more base functions from
java library, if you are not using pure core java. But I think there
will be some over heads.

I prefer C++ solution, if try to do it on a Unix box.

Changpeng Yu FT Computer Solutions

A Person to Person Business Site
Jason,

I have not tested what like you did. I just use map so simple to map <tag, text>. In C++, you can define the map as _tags, and add in the map by _tags[11]=“CliOrdID”. If you want to retrive, then do value = _tags[11]. It is so quick. I just don’t know what you try to tested.

I don’t use “new” mostly. If you forget to free them up, then there will be a memory leak. But you can be smarter. For example, I define one FIX object in whole FIX handler for Fix inbpund and outgoing message processing. There will no more space waste.

I am think the OS is wrotten by C and C++. C++ is definitly much closer
to the kernel level. You may compile the Java code, and get it optimazed
at most lower level. Now a days, the CPU is much powerful. The application running fast or slow, all determined by the design. The language may not show much difference. I implemented Web based OMS by a separate module. My FIX engine FixExpress is a pure FIX session level support. I choose C++ is I think it will be a small, multi-thread, quick solution. I did not give a second thought.

Good luck,
peng

FT Computer solutions
http://www.eptop.com/FIX/FixExpress.htm

Hello,

Thanks for responding.

I think I may off topic but this is interesting.

I am working on market data right now so I have to filter all these data to do some calculation.

as my manager is very c++ guys and would like to know the performance of java data structure and c++ data structure.

In this case, I need to use the new operator in c++ since there is million of data and the stack memory will overflow.

I was finding the time to insert all these data into map using either c++ or java. 30-40% of these data was duplicated. It seems to me java has faster running time. But, anyway, of course, it is CPU based too.

I need all these market data to read into memory to do some calculation.

I am using windows XP (Visual C++)

Back to FIX, i think C++ and java performance should be close enough.

Like you say, the CPU is fast enough in these day.

Most API in the market still written in C++. Definitely, C++ can do more thing than java.

I think for FIX, we just need the connection, we need to collect the fix message, send fix message for the basic.

I dont see many FIX Engine implemented in Java… (am I wrong?)most FIX Engine especially their API is implemented in C++. I guess C++ still good and powerful…

Regards,
Jason

I have not tested what like you did. I just use map so simple to map
<tag, text>. In C++, you can define the map as _tags, and add in the map
by _tags[11]=“CliOrdID”. If you want to retrive, then do value =
_tags[11]. It is so quick. I just don’t know what you try to tested.

I don’t use “new” mostly. If you forget to free them up, then there will
be a memory leak. But you can be smarter. For example, I define one FIX
object in whole FIX handler for Fix inbpund and outgoing message
processing. There will no more space waste.

I am think the OS is wrotten by C and C++. C++ is definitly much closer
to the kernel level. You may compile the Java code, and get it optimazed
at most lower level. Now a days, the CPU is much powerful. The
application running fast or slow, all determined by the design. The
language may not show much difference. I implemented Web based OMS by a
separate module. My FIX engine FixExpress is a pure FIX session level
support. I choose C++ is I think it will be a small, multi-thread, quick
solution. I did not give a second thought.

Good luck, peng

FT Computer solutions A Person to Person Business Site

[ original email was from Greg Orsini - greg.orsini@orcsoftware.com ]
Jason,

I dont see many FIX Engine implemented in Java… (am I wrong?)most FIX
Engine especially their API is implemented in C++. I guess C++ still
good and powerful…

Regards, Jason

Many of the major commercial vendors have implemented engines in Java (including ours).

Regards, Greg.

Hello Jason!

Sorry for late replay, maybe you already in coding now:) Anyway…
Many vendors now have FIX engines implemented on pure Java. My company most of the time working under heavy loaded applications with very high processing. We have choosed Java and quite happy with it. But this force us increase RAM on producation servers.

Right now difference between C++ and Java in network communication and data parsing not significant. FIX not required a lot of math and if you dont have huge amount of algo that need to be implemented - fill free use Java.

As for operation systems… IP stack is faster on Linux/Unix comparable with Win32/64. So if you looking for speed processing - look on this OS. Here Java also will be very useful.

Serg Gulko

AxonSoftware

By the way, what kind of FIX engine you plan to use?

Hello,

Thanks for responding.

I think I may off topic but this is interesting.

I am working on market data right now so I have to filter all these data
to do some calculation.

as my manager is very c++ guys and would like to know the performance of
java data structure and c++ data structure.

In this case, I need to use the new operator in c++ since there is
million of data and the stack memory will overflow.

I was finding the time to insert all these data into map using either
c++ or java. 30-40% of these data was duplicated. It seems to me java
has faster running time. But, anyway, of course, it is CPU based too.

I need all these market data to read into memory to do some calculation.

I am using windows XP (Visual C++)

Back to FIX, i think C++ and java performance should be close enough.

Like you say, the CPU is fast enough in these day.

Most API in the market still written in C++. Definitely, C++ can do more
thing than java.

I think for FIX, we just need the connection, we need to collect the fix
message, send fix message for the basic.

I dont see many FIX Engine implemented in Java… (am I wrong?)most FIX
Engine especially their API is implemented in C++. I guess C++ still
good and powerful…

Regards, Jason

I have not tested what like you did. I just use map so simple to map
<tag, text>. In C++, you can define the map as _tags, and add in the
map by _tags[11]=“CliOrdID”. If you want to retrive, then do value =
_tags[11]. It is so quick. I just don’t know what you try to tested.

I don’t use “new” mostly. If you forget to free them up, then there
will be a memory leak. But you can be smarter. For example, I define
one FIX object in whole FIX handler for Fix inbpund and outgoing
message processing. There will no more space waste.

I am think the OS is wrotten by C and C++. C++ is definitly much
closer to the kernel level. You may compile the Java code, and get it
optimazed at most lower level. Now a days, the CPU is much powerful.
The application running fast or slow, all determined by the design.
The language may not show much difference. I implemented Web based OMS
by a separate module. My FIX engine FixExpress is a pure FIX session
level support. I choose C++ is I think it will be a small, multi-
thread, quick solution. I did not give a second thought.

Good luck, peng

FT Computer solutions A Person to Person Business Site

Hello,

Thanks for responding. I do agree with you. I guess C++ definitely is
better than java because c++ is more powerful than java(of course, the
price is memory leak issue if ever occurred).

I actually compare the time of the STL’s map and java’s hashmap (no multi-
threading involve in this case as assumption).

It seems to me java is faster than c++ to look for key or insert a new
key/value for it assume we have 300k line of strings which 40% is
duplicated(market that collected using bloomberg API in visual c++).
Please correct me if I am wrong in above testing.

We do pay for the overhead for the garbage collection in java…

Anyway, for now, I am doing something basic OMS thing… But, maybe in
future I will need the c++ for system driver.

I will use java native to deal with c++ if i ever reach that point.

I guess C++ definitely is more powerful than java.

Regards, Jason

I am think C++ will have a better performance than Java do. Program
written in C++ is much pure than any other languages, one level up
from OS, and also gain more benefits from the robusted support
standard library (STL) functions. You may get more base functions from
java library, if you are not using pure core java. But I think there
will be some over heads.

I prefer C++ solution, if try to do it on a Unix box.

Changpeng Yu FT Computer Solutions

A Person to Person Business Site
Jason,

Sorry. I forgot to ask what kind of operating system you are using? All I am suggesting is based on Linux.

Good luck,
peng