forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 9:46 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Performance of LMA in C# vs C++?
PostPosted: Tue Aug 16, 2011 7:35 am 
Offline

Joined: Mon Oct 18, 2010 6:55 am
Posts: 8
Hi,

First off, thanks for a superb library. I use it daily in my work in finance. Recently I've experienced some performance issues when I try to use MinCreateV to bootstrap a curve in C#. I seem to remember reading somewhere that the performance of the C# was not the same as the C++. I need to decide if I should migrate my code to C++ or have another look at my C# code.

Regards


Top
 Profile  
 
 Post subject: Re: Performance of LMA in C# vs C++?
PostPosted: Tue Aug 16, 2011 7:50 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 903
Can you post your problem details? In particular, it can be useful to know:
* number of points
* number of parameters being fitted
* algorithmic complexity of the function used to fit points (hard to calculate, moderate complexity, easy one)

You may see 2-5 fold performance increase when moving from C# to C++, but there is some dependency on the problem details. Some configurations will give you moderate performance gain, while others will give higher one.


Top
 Profile  
 
 Post subject: Re: Performance of LMA in C# vs C++?
PostPosted: Mon Aug 22, 2011 7:20 am 
Offline

Joined: Mon Oct 18, 2010 6:55 am
Posts: 8
Hi,

Thanks for your reply (and a great lib). If it is 2-5 times faster in c++, then I think I must migrate.

The performance issue that I've noticed is basically the same regardless of the number of nodes, in relative terms. When I try to tweak the parameters, ie the precision or the size of the steps etc, I can affect the performance plenty. However, when I move from a test environment to the real world (with frequent updates and recalculations) it is obviously not enough.

In reply to your questions, I'll give you an example of a typical problem:

We need to make sure that a curve (given a spline or other interpolation method) reprices a group of swaps (2-10 years, 15, 20 and 30 years for example), with annual coupon payments vs 3 month payments. That is, we have 30 + 30 * 4 = 150 points that need to reprice 12 swaps. I'm not sure if this is particularily complicated. When I tweak this problem, I can get it down to under a second. We do this in other systems where it's done lightning fast.

I will try to optimize the way I'm approaching the problem and see if there is something that I've missed, but I doubt it.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 52 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group