Java vs C++ or C#

Discussion in 'Programming' started by CPTrader, Aug 4, 2010.

  1. I am curious as to people's opinions about building a realtime Automated Trading System (ATS) plus Backtester in Java. I have historically felt (rightly or wrongly) that Java is a resource (memory) hog and applications built in Java are slow.

    I am not an IT this is just my layman's opinion.

    Could the experts expound on this issue. Is a JAVA ATS OK for a mission -critical real-time ATS app or is Visual Studio/C#/C++ a better development language for such mission critical applications.

    Many thanks.
  2. januson


    If you are building the ATS from scratch then you could easily take any code-latency into consideration when you back-test it. On that way you can see which trades you are missing/ entering when compared to normal code-latency.

    My opinion.... build the ATS in the language you are sharpest at, if you are writing your methods correct it shouldn't make a big difference between Java, C++ or C#.
    Common awareness of a restrained usage of generics, delegates etc. should certainly be used in all languages.
  3. byteme



  4. Can you share some more details on your position.

    Thank you.
  5. byteme


    Java is used all over the place for mission-critical systems and has been for a number of years.

    I'll give you one relevant example:

    Lime Brokerage, who execute up 3-5% of US equity market volume and average 750 million shares a day (2008), use Java-based infrastructure for HFT.

    Worrying about which language to choose is largely time wasted.
  6. Thank you byteme!
  7. gtor514


    If what's critical in your mission critical app is a lot of processing and calculation of data, c++ is the way to go hands down. I can see where some HFT routines could be implemented where seconds count and you would want to use c++. c++ can be on a order of 2-30 times faster for some calcs, such as sorts and transforms.

    Keep in mind that many backtesting and ATS programs can be a java frontend and all the guts are in another language like python or c++.
  8. januson


    Kind of funny to keep reading these occasionally.

    This goes to both CPtrader and you! ->

    I can guarantee you both that it will not be the language that creates the bottleneck, Java, C# or C++ , same same....

    What you really should be worrying about is the tick/ trade/ quote-rate at which your provider can deliver his feed and how many messages your trading- pc/ server/ portable can process.

    What you read about.. take for instance... StreamBase, Esper that announce events up to 500.000 per second, this is nothing compared to doing it yourself.
    I will soon post my performance measures of commercial CEP contra Homebrewed CEP.

    Feel free to inspect the comparison between c++, c# and java:

    Remember to do your homework before posting such content :p
  9. Do you know something we don't? True, Lime advertises for Java people but it's a big stretch from that to <i>Java-based infrastructure for HFT</i>. You gave their homepage as a link, but there's nothing relevant on that page.
  10. byteme


    Why don't you ask them yourself?

    That's what I did 4/5 years ago and that's what I was told. I'm sure there's a lot of native code involved too.

    My point was, as per the topic of the thread, in the absence of more specific non-functional requirements Java is fine for mission-critical real-time is C++ and C#.

    I'd be interested to hear what you find out from them today.
    #10     Aug 6, 2010