Re: Java for financial models

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Java for financial models

QuantLib
Greetings,

I am a programmer, working in C++ derivative models development.  Before that
I worked as Java Architect and programmer, developed complex projects since
Java started.
I have a question about Java for financial calculations.  My opinion -- it is
rather slow for numerical and simulation algorithms like finite diffs or
Monte Carlo. But recently I had a chat with Morgan Stanley people, who told me
that Java is fast enough.  I wonder what QuantLib folks think about Java
performance?  Anybody tried Java for derivatives pricing in production?

Best regards,
George


Reply | Threaded
Open this post in threaded view
|

RE: Re: Java for financial models

cuchulainn
[Quantlib-users] Re: Java for financial models
Java is a general purpose OO language but it does not support procedural paradigm which IMO is a problem for numerical maths and FDM (C++ supports OO, procedural and template programming). Java is of course slower than C++. It does not support operator overloading and this is terrible for mapping my formulas to code.
 
These days you can write code (under .NET) in managed C++ (FDM) and the GUI in C# (C# is really Java in IMO), so life is beautiful. Of course, this solution does not port to Linux.
 
Personally, I prefer C++ to Java. That is not to say that Java does not have its charms. But for number crunching I doubt it.
 
Daniel J. Duffy
 
 
P.S. In the old days we had DOMAIN-SPECIFIC languages such as Fortran (great for algorithms). These days we have to bend general-purposes languages such as Java and C++ to emulate the same features Fortran.

From: [hidden email] on behalf of [hidden email]
Sent: Wed 25/08/2004 22:08
To: [hidden email]
Subject: [Quantlib-users] Re: Java for financial models

Greetings,

I am a programmer, working in C++ derivative models development.  Before that
I worked as Java Architect and programmer, developed complex projects since
Java started.
I have a question about Java for financial calculations.  My opinion -- it is
rather slow for numerical and simulation algorithms like finite diffs or
Monte Carlo. But recently I had a chat with Morgan Stanley people, who told me
that Java is fast enough.  I wonder what QuantLib folks think about Java
performance?  Anybody tried Java for derivatives pricing in production?

Best regards,
George


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Quantlib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

Reply | Threaded
Open this post in threaded view
|

Re: Re: Java for financial models

Luigi Ballabio-2
Hi,

On 2004.08.25 22:42, Daniel J. Duffy wrote:
> Java is of course slower than C++.

True, but though slower it might be fast enough for one's needs.
However, I have no personal experience using Java for pricing.

> It does not support operator overloading and
> this is terrible for mapping my formulas to code.

So true. I can't imagine having to write

(v1.plus(v2)).times(w1.minus(w2));

instead of

(v1+v2)*(w1-w2);

And formulas are rarely that simple. That's mostly what kept me away  
from Java...

Bye,
        Luigi


Reply | Threaded
Open this post in threaded view
|

RE: Re: Java for financial models

cuchulainn
In reply to this post by QuantLib
Luigi,
I agree 100% with you, very good example.

Daniel

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]]On Behalf Of Luigi
> Ballabio
> Sent: 26 August 2004 09:37
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: [Quantlib-users] Re: Java for financial models
>
>
>
> Hi,
>
> On 2004.08.25 22:42, Daniel J. Duffy wrote:
> > Java is of course slower than C++.
>
> True, but though slower it might be fast enough for one's needs.
> However, I have no personal experience using Java for pricing.
>
> > It does not support operator overloading and
> > this is terrible for mapping my formulas to code.
>
> So true. I can't imagine having to write
>
> (v1.plus(v2)).times(w1.minus(w2));
>
> instead of
>
> (v1+v2)*(w1-w2);
>
> And formulas are rarely that simple. That's mostly what kept me away  
> from Java...
>
> Bye,
> Luigi
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
> 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
> Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
> http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
> _______________________________________________
> Quantlib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>


Reply | Threaded
Open this post in threaded view
|

Re: Re: Java for financial models

ML-21
In reply to this post by cuchulainn
[Quantlib-users] Re: Java for financial models> Java is of course slower
than C++. [...] These days you
> can write code (under .NET) in managed C++ (FDM)
> and the GUI in C# (C# is really Java in IMO), so life is
> beautiful. Of course, this solution does not port to Linux.

How does C++.NET compare to Java in terms of performance? After all, .NET
also runs on a Virtual machine.

Yes, .NET has a JIT compiler, which makes programs run in native mode, and
hence faster, but don't JIT compilers exist as well for Java?

So, is there really a difference in speed?

-Mario



Reply | Threaded
Open this post in threaded view
|

Re: Java for financial models

Gianni Piolanti
In reply to this post by QuantLib
Hi Luigi,
 
I agree with you when you say that c++ operator overloading it allows to write
complex expressions by using a mathematical notation. But operator overloading
can create a lot of temporary objects. Expression template technique efficiently
avoid temporary objects and there are libraries (PETE,POOMA,Blitz++, boost-ublas)
implemented by using such technique. On the other hand there are libraries such as
MTL or GMM++ which avoid operator overloading in order to reach better run-time efficiency.
Albeit C++ it's a better choice my opinion about java 5.0 (which adopt template) is that it can reach a good trade-off between "easy of use" a more advanced number-crunching and difficulties which can arise evaluating complex expressions.
 
ciao - Gianni


Personalizza MSN Messenger con sfondi e foto. E' divertente!