HOME FORUMS BROKERS SOFTWARE BOOKS CONTACT US
Elite Trader Your Account  •  Become a Member  •  Help  •  Search    
    Forums ›› Technically Speaking ›› Programming ›› Java vs C++ or C#  


Post A Reply
    Page 6 of 7:   1  2  3  4  5   6  7  
christianhgross
 

Registered: Jul 2008
Posts: 353

 

09-01-11 05:00 PM

I have written automated systems in all three languages.

First C++ is WAY WAY WAY overrated as a superior language. I am an old guy here and I remember when the Fortran people used to say, "oh that C++ will never be as fast as Fortran". Lo and behold it was and now the C++ people are saying the same thing.

With all that being said, the reality is as follows.

C++ is faster if you chuck the "safety" features of programming languages and avoid things like STL, and Boost. In raw bytes to bytes C++ is faster, but then again so is C.

The moment you add the baggage of STL, and Boost you are slower than well written C# code. The advantage that the C# JIT and Java jit have is that those safety features are well optimized. C++ safety features rely on the optimization of the compiler.

Thus if you are not careful with your STL, and Boost code you will have a lame duck of an application.

If you are not careful with your object references in C# or Java then you will also have lame duck applications.

Let me illustrate... We all know about OHLC (Open High Low Close) The classical object approach is to define the OHLC as individual classes and put it into a List<OHLC>.

THAT IS MEGA SLOW... In C# you need to define the OHLC as a struct and then create an array like the following OHLC[]. That simple step in itself has a massive speed up factor.

I personally would never touch C++ again. I would rather tweak and optimize my C# or Java code. My development with C# or Java is 100 times more productive than farting around with a dangling C++ pointer that causes a core dump.

If you plan on using C# or Java make sure to invest into a profiler like the one from Jet Brains. A profile will quantify what is slow code, and not be reliant on what you think is slow.

    Edit/Delete Quote Complain
rwk
 

Registered: Dec 2003
Posts: 983

 

09-01-11 05:36 PM


Quote from christianhgross:
... My development with C# or Java is 100 times more productive than farting around with a dangling C++ pointer that causes a core dump...

Programmer productivity is almost always the more important factor, and so the best language is usually the one you already know (unless it's Fortran or Cobol ). Also, upgrading to more powerful hardware is often cheaper than re-optimizing software unless you've done something really dumb.

    Edit/Delete Quote Complain
christianhgross
 

Registered: Jul 2008
Posts: 353

 

09-01-11 06:34 PM


Quote from rwk:

Programmer productivity is almost always the more important factor, and so the best language is usually the one you already know (unless it's Fortran or Cobol ). Also, upgrading to more powerful hardware is often cheaper than re-optimizing software unless you've done something really dumb.



I did not want to say that as an argument... But yeah I agree with you. I am so much more productive with C#, or Java.

    Edit/Delete Quote Complain
syswizard
 

Registered: Jun 2004
Posts: 3613

 

09-02-11 02:08 PM

I think one of the largest Java platform's is ThinkorSwim's desktop application. It's gotta be 1/2 million lines of code....at least.....and it uses multithreading to-the-max.

    Edit/Delete Quote Complain
christianhgross
 

Registered: Jul 2008
Posts: 353

 

09-02-11 07:58 PM


Quote from syswizard:

I think one of the largest Java platform's is ThinkorSwim's desktop application. It's gotta be 1/2 million lines of code....at least.....and it uses multithreading to-the-max.



Or Interactive Brokers... Think or Swim is considered a dog by some. However I always thought IB's TWS was pretty quick.

    Edit/Delete Quote Complain
bln
 

Registered: Nov 2009
Posts: 78

 

09-03-11 09:32 AM

In my humble opinion higher abstract level languages like Java, C#, Scala, etc is to bloated for any low latency work.

Abstraction add overhead, object orientation add overhead. Bad design add overhead.

I use C and Assembler for my HF and algo stuff as it's what I'm used to and is a little bit faster than C++.

Some stuff of concern to me:

- Most efficient L1/L2/L3 cache utilization. Use as small data types as possible to pack as much data as possible into the caches.

- Context switching and maximum best thread design, keep all cores saturated at full speed at lowest overhead.

- Most efficient transfer and utilization of the memory bus between the main memory and CPU/Caches, here size of the used data types play an role.

- Lowest size footprint, you want your code and variables to reside in the caches to the most so you do not get to much slow memory access.

    Edit/Delete Quote Complain
    Page 6 of 7:   1  2  3  4  5   6  7  
Post A Reply


Receive an email whenever a new post is added to this thread by subscribing to it.
 
Rate This Thread:

Forum Jump:
 

 

   Conduct Rules  -  Privacy Policy  -  Day Trader -  Day Trader Forum -  Best Trading Software -  Sitemap Copyright © 2013, Elite Trader. All rights reserved.    
 
WHILE YOU'RE HERE, TAKE A MINUTE TO VISIT SOME OF OUR SPONSORS:
Advantage Futures
Futures Brokerage & Clearing
AMP Global Clearing
Futures and FX Trading
Bright Trading
Professional Equities Trading
CTS
Futures Trading Software
DaytradingBias.com
Professional Trading Analytics
ECHOtrade
Professional Trading Firm
eSignal
Trading Software Provider
FXCM
Forex Trading Services
Global Futures
Futures, Options & FX Trading
Interactive Brokers
Pro Gateway to World Markets
JC Trading Group
Direct Access Trading
MB Trading
Direct Access Trading
MultiCharts
Trading Software Provider
NinjaTrader
Trading Software Provider
OANDA
Currency Trading
optionshouse
Option Trading & Education
Rithmic
Futures Trade Execution Platform
SpeedTrader
Direct Access Trading
SpreadProfessor
Spread Trading Instruction
thinkorswim by TD Ameritrade
Direct Access TradingAdvertisement
TradersStudio
System Building & Backtesting
Trading Technologies
Trading Software Provider
Trend Following
Trading Systems Provider