• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java or C++  RSS feed

 
Jonathan Andrew King
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,
I don't want to start a war here but I am working on a Real-Time data collection system were I can either use Apache, Tomcat & Bespoke Java (Servlet API) with a Message Queue or stick to an Apache Mod with C/C++.
The processing I need to do before sending it on it's way involves a lot of string comparisions, data translation and cross referencing entries within dynamic data structures.
With a potential average of 3,000 transactions per second I am worried that Garbage Collection may never kick in and I will spend a lot of time performance tuning my java.
The other path would be the C/C++ which means implementing threads on Unix, re-implementing some of the functionality given by a servlet engine but tuned to my own needs.
Any advice ?

 
Mark Herschberg
Sheriff
Posts: 6037
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the easiest thing to do is to throw more hardware at it.
In terms of fast string comparisons, what about alternatively formats. For example, it sounds like you'll be getting these strings over a network. If that's the case, maybe you could read them from the network into objects other than Strings, e.g byte[]. If that's the case, the byte comparison is faster, because it doens't need to "hash" the String. Plus, byte[] aren't immutable, like strings. (Well, they are, I suppose, but you can replace the contents, which you can't with a String. Hmm, is it actually immutable, I'm not sure whree to draw the line.) More generally, you can define a custom class which can take in the data and compare it, which may be faster in terms of memory and processor speed.
What about using JNI calls? I don't know the memory issues here, but it may help with speed. Because of the very high overhead, you'd need to "batch process" the comparisons. This may or may not be acceptible given your other constrains.

--Mark
hershey@vaultus.com
 
Jonathan Andrew King
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the reply, throwing more hardware at it is not an option as a some point the cost of collecting the data will exceed the value of the data.
The data arrives in CGI format so the Servlet API will have it as strings already. If I am going to end up with JNI then I might as well start native. The whole point of the excercise is to avoid batch processing.
That last paragraph seems very negative, I am being given a bank of Dual 1Ghz PIII with 1Gb Memory, 4 with SSL in hardware & 7 without, add to this load balancing and support PCs. I think that my best course of action is to write some software and take it for a spin .....
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!