aspose file tools
The moose likes Performance and the fly likes Calling C or C++ methods from Java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Performance
Reply Bookmark "Calling C or C++ methods from Java " Watch "Calling C or C++ methods from Java " New topic
Author

Calling C or C++ methods from Java

prabal nandi
Greenhorn

Joined: Jun 28, 2011
Posts: 18

if i make a java application running on a server, which is calling C or C++ methods having all the busniess logic, will that make my application faster compared to a normal java application.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 13842

Not a portlets question. Moving.
prabal nandi
Greenhorn

Joined: Jun 28, 2011
Posts: 18

JavaRanch » Java Forums » Java » Performance
prabal nandi
Greenhorn

Joined: Jun 28, 2011
Posts: 18

Sorry i guess this post got posted twice.. "JavaRanch » Java Forums » Java » Performance ". this will be the correct path.
but can somebody seriously help me out and can also provide a proper explaination.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11862
Creating and calling the interface to JNI methods certainly will consume some CPU time so your C or C++ would have to be faster to justify that.

If multiple clients can access the application, you would have to manage the separate requests. If database access is involved in the business logic that CPU time would probably be much more important than execution of logic code so the language won't matter.

Bill

Java Resources at www.wbrogden.com
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 13842

That might make your code faster. But it would have to make it a whole lot faster before it was worth doing, if you're talking about a server application.
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 343

There are lots of good reasons to call c++ from java and business logic isn't one of them generally.

JNI has an over head and unoptimised C++ can run slower than Java, Javas is not that slow any more check out some benchmarks on the web before proceeding.


"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
 
 
subject: Calling C or C++ methods from Java
 
Threads others viewed
From Valiveru's mock exam
Visual C++ required???
need of obfuscation code with web application and how to do it
this(Color.Red) ?
RMI+JNI or CORBA?
IntelliJ Java IDE