Posts

Computational Performance in Fintech Applications

Image
computation Many types of applications do not require high-performance computations because they simply perform very few or infrequent calculations. This also applies to many financial applications. However, there are financial applications, such as banking or insurance ones, that occasionally perform a significant number of computations. In this article, I will show an example of an application that calculates simulations of profits from investment funds, where the simulation time was reduced 100-fold (in words: a hundred times). The observations made are universal and can be applied in other cases as well. Calculation Accuracy As we know, calculation accuracy depends on the data type used. In Java, for example, we have types: float , double , which have limited precision int , long , which allow storing integers losslessly BigDecimal , which allows storing decimal numbers with any specified precision In most projects I have seen, financial calculation...

JDBC fetch size - commonly forgotten setting

Image
JDBC fetch size parameter can significantly reduce the result set fetching time. It can be set on any Statement or PreparedStatement object. Many frameworks like Spring or Hibernate give you very convenient API to do this. Although this parameter is widely available, I discovered that a lot of projects I have visited did not configure the fetch size and thus was using its default value. Yet, the default value can result in a poor performance on some jdbc drivers. I want to show you how much you can improve your fetching performance if you adjust the fetch size to your statements. The scale of improvement depends on the driver you use. Oracle jdbc driver Assume we have table with 1 million rows and for any reason we have to fetch all records into JVM. How fast you can get all data? What fetch size will Oracle use if you don’t set it explicitly? Figure 1 - fetching 1M rows with different fetchSize values (local oracle database) Figure 1 shows fetching times for dif...