473,837 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server app speed - Java vs C++

Which is typically faster - a Java server application or a C++ server
application?
Oct 2 '05 #1
19 3207
Davey wrote:
Which is typically faster - a Java server application or a C++ server
application?


Faster at what? C++ run-time performance is generally superior,
regardless of the current zeitgeist that "nobody should be avoiding Java
for performance reasons." But if you're talking about a long-running,
multithreaded, I/O-bound application, e.g. a web server, the Java
application might actually be faster, and almost certainly will be
faster to develop.
Oct 2 '05 #2
"Jeff Schwab" <je************ @rcn.com> wrote in message
news:uK******** ************@rc n.net...
Davey wrote:
Which is typically faster - a Java server application or a C++ server
application?
Faster at what? C++ run-time performance is generally superior,
regardless of the current zeitgeist that "nobody should be avoiding Java
for performance reasons."


Thanks for the answer.
But if you're talking about a long-running, multithreaded, I/O-bound
application, e.g. a web server,
Yes, I'm talking about the server-side component of a client-server
application. It will involve reading data from a database and sending the
information to clients apps depending on requests from those apps.
the Java application might actually be faster, and almost certainly will
be faster to develop.


OK, thanks.
Oct 2 '05 #3
Davey wrote:
"Jeff Schwab" <je************ @rcn.com> wrote in message
news:uK******** ************@rc n.net...
Davey wrote:
Which is typically faster - a Java server application or a C++ server
applicatio n?


Faster at what? C++ run-time performance is generally superior,
regardless of the current zeitgeist that "nobody should be avoiding Java
for performance reasons."

Thanks for the answer.

But if you're talking about a long-running, multithreaded, I/O-bound
application , e.g. a web server,

Yes, I'm talking about the server-side component of a client-server
application. It will involve reading data from a database and sending the
information to clients apps depending on requests from those apps.

the Java application might actually be faster, and almost certainly will
be faster to develop.

OK, thanks.

When C++ behaves badly, it crashes. When java behaves badly, its
not hard to make it local or recoverable.

Java is fast enough on the server side, especially where the database is
likely to be the bottleneck.

The difference in speed doesn't make up for the added safety of java.

Oct 2 '05 #4
Wibble wrote:
Davey wrote:
"Jeff Schwab" <je************ @rcn.com> wrote in message
news:uK******** ************@rc n.net...
Davey wrote:

Which is typically faster - a Java server application or a C++
server application?
Faster at what? C++ run-time performance is generally superior,
regardless of the current zeitgeist that "nobody should be avoiding
Java for performance reasons."
Thanks for the answer.

But if you're talking about a long-running, multithreaded, I/O-bound
application, e.g. a web server,


Yes, I'm talking about the server-side component of a client-server
application. It will involve reading data from a database and sending
the information to clients apps depending on requests from those apps.

the Java application might actually be faster, and almost certainly
will be faster to develop.


OK, thanks.

When C++ behaves badly, it crashes. When java behaves badly, its
not hard to make it local or recoverable.


Poorly written C++ code crashes. Poorly written Java code crashes, e.g.
with a NullPointerExce ption. Well written code in either language does
not crash.
Java is fast enough on the server side,
That depends what's being done.
especially where the database is
likely to be the bottleneck.
True.
The difference in speed doesn't make up for the added safety of java.


The added speed may or may not be worth trading away for Java's
mandatory run-time checks. C++ provides better static safety checks,
and makes many Java-like run-time checks available, just not mandatory.
Oct 2 '05 #5
Ian
Davey wrote:
But if you're talking about a long-running, multithreaded, I/O-bound
application , e.g. a web server,

Yes, I'm talking about the server-side component of a client-server
application. It will involve reading data from a database and sending the
information to clients apps depending on requests from those apps.

In this case, run time performance is a secondary consideration, use the
environment you are most familiar with.

Ian
Oct 2 '05 #6
On Sun, 02 Oct 2005 12:19:31 GMT, "Davey" <da***@hotmail. com> wrote or
quoted :
Which is typically faster - a Java server application or a C++ server
application?


I don't think there would be any contest in who has the better chance
of getting a bug free program first. Java is much better designed for
that.

I would say that a C++ server app, if you allowed say 10 years to
polish the code would do better than the equivalent server app given a
similar length of time, but that does not happen in real life.

What happens in real life is, you have a fixed time budget. The C++
programmer spends it coding. The Java programmer has some time left
over to test and optimise and refactor.

As systems get more complex, it does not matter if they can deliver
wrong answers more quickly. What counts is getting the right answer
in an acceptable length of time.

When I started out, CPUs rented for well over $100 per hour. It thus
made sense to spend considerable programmer to reduce CPU time. Today
the roles are reversed. It pays to spend CPU time to save programmer
time.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Oct 3 '05 #7
On Sun, 02 Oct 2005 14:57:00 -0400, Wibble <Wi****@Mailina tor.com>
wrote or quoted :
Java is fast enough on the server side, especially where the database is
likely to be the bottleneck


or the datacommunicati ons. You can find out which by comparing how
the app behaves on a LAN compared with out there on the web.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Oct 3 '05 #8
On Sun, 02 Oct 2005 16:31:02 -0400, Jeff Schwab
<je************ @rcn.com> wrote or quoted :

Poorly written C++ code crashes. Poorly written Java code crashes, e.g.
with a NullPointerExce ption. Well written code in either language does
not crash.


Consider how large programs are now. If you have probability p
(expressed as number between 0 and 1 e.g. 1/1,000,000) that a given
line contains an error, then the odds of a program N lines long being
perfect is:

N
(1-p)
You see how the math works against you because N, the size of the
program is in the exponent. So in other words, no matter how careful
your programmers, in large programs, errors are unavoidable.

C++ was designed back when programs were small and it was possible to
avoid error with sufficient skill and care.

Java takes a more realistic view that there will inevitably be errors
in large programs no matter who wrote them.

How can you find them? (avoiding pointers, null pointer and array
bounds checks) How can you keep doing even when they happen? (catch)
How can you flush them out? (assertions)

How could we do even better? (design by contract).

see http://mindprod.com/jgloss/designbycontract.html
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Oct 3 '05 #9
Roedy Green wrote:
C++ was designed back when programs were small and it was possible to
avoid error with sufficient skill and care.

Java takes a more realistic view that there will inevitably be errors
in large programs no matter who wrote them.

How can you find them? (avoiding pointers,
....you can do that in C++, if you like, or use smart pointers such as std::auto_ptr, or boost::shared_p tr
null pointer
Use references instead of pointers.
and array bounds checks)
std::vector.
How can you keep doing even when they happen? (catch)
....like in C++.
How can you flush them out? (assertions)
Yeah.
How could we do even better? (design by contract).

see http://mindprod.com/jgloss/designbycontract.html


I fail to see what your first 2 sentances above are about.

Ben
--
I'm not just a number. To many, I'm known as a String...
Oct 3 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1943
by: chiefprogramer | last post by:
How to build up a good frame for a mathematical system and it's ultra-high-speed? Althought In PHP 5 there is a new Object Model. But I think the new Object Model is still very slow >< Just like statement "f();" cost 1148 ns "fffffffffff();" cost 1273 ns (1 function char cost 13 ns) "$z->f();" cost 1865 ns
0
1287
by: Alexander DEJANOVSKI | last post by:
JyRetic 1.0RC3 was just released. (http://retic.sourceforge.net) Changes are (I might have forgotten some bug fixes): - Bug fix : Scheduled events didn't work if no parameter file was required - Improvement : Speeded up SQL source when there were several records to extract (~x10) - Improvement : since JDBC drivers return rowcount on query execution, there's no need
30
2832
by: Mike Cox | last post by:
Hi. I recently ran a benchmark against two simple programs, one written in Java and the other in C++. The both accomplish the same thing, outputting "Hello World" on my screen. The C++ program took .5 seconds to complete on my 400 Mhz PC while the Java program took 6.5 seconds. I am running the SUSE 8.2 Linux distribution. Why is Java that much slower than the C++ program? I read on Slashdot that Java was almost as fast as C++. ...
53
3462
by: Krystian | last post by:
Hi are there any future perspectives for Python to be as fast as java? i would like to use Python as a language for writing games. best regards krystian
25
5777
by: abhinav | last post by:
Hello guys, I am a novice in python.I have to implement a full fledged mail server ..But i am not able to choose the language.Should i go for C(socket API) or python for this project? What are the advantages of one over the other in implementing this server.which language will be easier? What are the performance issues?In what language are mail servers generally written?
1
1455
by: =?ISO-8859-15?Q?Ma=EBl_Benjamin_Mettler?= | last post by:
Hello Python-List I hope somebody can help me with this. I spent some time googling for an answer, but due to the nature of the problem lots of unrelevant stuff shows up. Anyway, I reimplemented parts of TigerSearch ( http://www.ims.uni-stuttgart.de/projekte/TIGER/TIGERSearch/ ) in Python. I am currently writing the paper that goes along with this reimplementation. Part of the paper deals with the
14
3577
by: rabbitrun | last post by:
Hi Everyone, I work for a financial company. I am planning to give a presentation to rest of the development team (15 people) here on moving server side logic to client-side javascript for an internal intranet application rewrite. This approach will definitely stir up hot debate from hardcore server-side Java folks who wants to do UI stuff even on the server!. Since I am pretty much known as the JS or UI Guy of the group, my Boss...
2
1467
by: robinsand | last post by:
There has been much discussion in these groups about the speed of C++ relative that that of Java for performing given functions and when run on specified compilers. Does anyone know how C++'s speed compares to C#.net's? Does it depend on the particular task being executed and the compiler running the code (or not)?
2
1817
by: JosAH | last post by:
I run my Java programs on a small Linux laptop and today I installed it again on a MS Vista laptop.My linux laptop ran quite a bit faster than my Vista laptop and I decided to find out why. After a bit of digging I found out that the 'server' hotspot comes with the Linux JRE distribution but it isn't there in the MS Windows distribution; it comes with the JDK though. This is what I'm talking about: go to your JAVA_HOME location; that...
0
9839
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9682
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10564
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10621
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9396
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7806
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3123
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.