Quote from dholliday:
Hi Wayne,
I am looking forward to trying your software. I would like to put a vote in for a Java version. Vista has pushed me over the edge, I want to run on Linux. As for speed, Java has been faster than C++ for most operations for many years now. I am an ex C++ programmer and there are a few things I miss from C++, but standard libraries and threading across operating systems made me switch. Java does have some disadvantages though. In general they are: slow startup, high memory usage, approximately 10% slower IO (this continues to get faster), slow trig functions (Java meets IEEE standards, but who cares). The reason Java is generally faster is the Hot Spot complier, which continues to optimize your code as it runs. Also Java memory allocation and garbage collection is much faster than C++ (go figure). Okay, most of these thing don't really matter, what matters is running fast on multiple platforms, and really fast on Linux (much faster than Windows).
Thanks for your great effort,
David
I share your love for Java. If nothing else, it has provided my family a nice income for a number of years.
Java is very fast as I have argued on here myself.
However, I have run into some limitations in Java which are infuriating when you're trying to write low level, very high speed code. That has forced me to reconsider.
NOTE: We are committed to supporting Java and C#, .NET for the higher level stuff like you're own trading rules.
sizeof(). Did you realize that it's impossible to find out the exact number of bytes in a Java class? That's no such equivalent to sizeof() in C++ and C#.
There
is some rough experimentation you can do like allocate a bunch of objects and manually measure the amount of memory divided by the number of objects to get an idea of the size but it does
not equal the size of the members.
Also, I have found that using "pointers" are necessary for very high speed memory manipulation and faster at moving bytes around. Java has zero ability to do that. Also, structs give far better performance in certain cases that classes.
So I have been forced to face a hard reality. What we're writing here in TickZOOM needs to run at the same level as the compilers that convert byte code to machine code. In other words, low level--high speed code.
And those byte compilers are not written in Java, obviously. They're written in C or C++.
While it's true that, C# has these features and therefor can be
extremely fast, it nevertheless is a real hassle the lack of platform independence. Why?
Well, everyone says, "run mono on Linux". But did you know that mono only runs C# version 2.0 at this moment?
I was using C# 3.5 to build TickZOOM which means it wouldn't run on mono. Last week, I reverted back to 2.0 and that forced changing some minor stuff.
But, isn't it a little bit annoying that Microsoft won't support Linux for .NET? So the open source community will always be behind the C# versions.
Another amazing thing has happened. I have been reviewing C++ again to get up-to-date and have found a number of surprising things.
Which only makes sense because it has been over 10 years since I worked with C++.
They now have (I never noticed) full Eclipse integration for GNU.
They have STL (standard template library) and many other standard libraries as part of the GNU project.
Also, the GNU compiler "cross compiles". That means unlike the old days, you can compile code that will run on a variety of servers without even having those servers around! And everyone reports (including vendors like IBM and Sun) that it works reliably and therefore is often better to use than their own proprietary compilers.
That solves the cross platform issue nicely, doesn't it?
Here's the BIG discovery for me at least, C++ now has garbage collection. Wow. That makes it much easier to never worry about missing free() calls.
In short, it has become obvious that C++ is the right choice long term for the low level code in the Engine.
HOWEVER, please don't worry about that because C++ operates with Java and C# nicely. (Obviously, those byte compilers are written in C++.)
So you can still write your trading models in Java but the engine will convert to C++.
NOTE: We have adopted the term "model" instead of "strategies and indicators".
Well, again, the most critical need is supporting the various languages for the high level programming of your trading rule models.
Sincerely,
Wayne