Saturday, July 04, 2009
You are here:  Blog
 
Search Blogs Minimize
FinFolio Blogs Minimize
Blog_Archive Minimize
FinFolio Blog
Nov 7

Written by: Matt Abar
11/7/2008 12:05 PM

We've been tracking the speed of various "bottleneck" processes throughout FinFolio's development. I run them from time to time, to make sure there aren't any problems lurking. We're up to 13 different tests. Each test hits an isolated feature multiple times and reports the average time per run. The Per # (ms) column is the average amount of time it takes to run the test, and the # Per Sec column is the number of tests that can run per second.

These results are on my development box, which has two 4-core processors, 8GB RAM, and runs Vista-64. However, the tests are single threaded, so when I run them on a single processor machine with 2GB of RAM, they're only marginally slower.

T#

Benchmark                         

   Total (s)

    #

  Per # (ms)

   # Per Sec

 

1 

Import - Activity (Conversion)    

      0.2861

  500

        0.57

     1,747.8087

 Imported 10 new accounts, each with 5 positions and 10 activities.

2 

Import - Activity (Daily Import)  

      0.3913

   10

       39.13

        25.5543

 Imported 10 new accounts, each with 5 positions and 10 activities.

3 

Rollup - Accounts                 

      0.0245

    5

        4.89

       204.4254

 Rolled up 5 new accounts, each with 5 positions and 10 activities.

4 

Rollup - Positions                

      0.0265

   25

        1.06

       942.7914

 Rolled up 25 new positions, 10 activities.

5 

Database - Load Accounts (Naked)  

      0.2393

   50

        4.79

       208.9275

 Loaded 50 accounts, no collections loaded.

6 

Database - Load Accounts (Current)

      2.5888

   10

      258.88

         3.8628

 Loaded 10 accounts/positions/securities, 5 positions for each account. This is the data shape needed for current market values.

7 

Database - Load Accounts (Full)   

     11.6800

   10

    1,168.00

         0.8562

 Loaded 10 accounts/positions/activities/taxlots/securities, 200 activities for each account. This is the data shape needed for editing accounts.

8 

Rebalance - Adherence Only        

      0.1874

   10

       18.74

        53.3565

 10 new portfolios, each with 2 accounts, having 10 positions and 10 activities in each account.

9 

Rebalance - All                   

      1.2302

   10

      123.02

         8.1285

 10 new portfolios, each with 2 accounts, having 10 positions and 10 activities in each account.

10

Calculations - MarketValue Current

      0.0821

  500

        0.16

     6,089.4961

 Calculated MarketValue() for 500 new accounts, each with 5 positions and 10 activities.

11

Calculations - MarketValue Historic

      0.0700

  500

        0.14

     7,140.2560

 Calculated MarketValue(date) for 500 new accounts, each with 5 positions and 10 activities.

12

Calculations - IRR                

      0.1692

   50

        3.38

       295.4658

 Calculated 1-month IRR for 50 new accounts, each with 5 positions and 10 activities.

13

Calculations - Contributions      

      0.1294

  500

        0.26

     3,863.7010

 Calculated 1-month Contributions for 500 new accounts, each with 5 positions and 10 activities.

If a certain area of the software is slower than it should be, we dive in to the code and figure out why. A good example is the rollup component, which keeps a running share balance for each account position. It used to be a couple of orders of magnitude slower until Mike optimized the code and fiddled with the account structure.

The main test we've been keeping our eye on is #2, the daily import speed. At Techfi, the daily imports were by far our biggest bottleneck. On a fast desktop machine, we could only import ten transactions a second because, unlike other competitor's systems, we were rolling up our share balances on the fly. We did the Techfi rollup in database triggers, to ensure there was never a case where we had incorrect running share balances on our activities or positions. As I mentioned, other PMS systems don't necessarily do that. When I worked at dbCAMS, they had a rollup process that you had to kick off manually. If you didn't, your data could be incorrect. With Advent, you had to kick off a separate calculation process that pre-calculates your report data.

I believe separating the import elements is a bad idea. It leaves temporary gaps in your data, and complicates your operations processes. So with FinFolio, not only are we still rolling up transactions as they are added to the database, we're also allocating cost and tax lots, something that was a separate process at Techfi. It also fires a custom event model that does things like check your share balances against custodial balances and runs numerous other integrity checks, generating errors, warnings and alerts when necessary. All of this happens in-line, as data is added or changed.

Despite the much larger work load, FinFolio's imports seem to be running about 300% faster than Techfi's did. And FinFolio's imports will be automatically multi-threaded using the FinFolio process manager, which doesn't happen in the tests. This will get you even more speed (assuming you have multi-core or multi-threaded processors), and lets you keep doing work while your imports run in the background.

Which test is our biggest concern right now? In general, I'm comfortable with our speed, but if I had to pick one, it would be #7, loading a full account tree from the database. One of the downfalls of a rich object model is that you need to have lots of objects loaded before the rollups, cost allocation, etc. can work correctly. So to load a single account, complete with positions, securities, prices, activities, tax lots, tax lot adjustments, alerts, etc., takes almost a full second. Although that number is high enough that I think there may be a bug in there somewhere.

Changing the subject, we're currently working on the Techfi Portfolio 2000 import. If you're in the beta group and are currently running on P2K, we'd like to get a copy of your data to test. Please contact me at MattAbar@finfolio.com. Thanks!

Tags:
Privacy Statement | Terms Of Use