# Calculating by blocks

We call a block of data with the mathematical term matrix. A Matrex matrix can contain numbers, text, dates, boolean values.

This approach is in general better than the original calculation by cell for big quantities of data like columns of database tables, feeds, csv files. It is always more usual to write spreadsheets containing this kind of data, so this should be the right way to go.

For these data the calculation by blocks gives:

- Better performance: the function is called only once with blocks of data as parameters instead of many times with cells as parameters.
- Multithreading: functions are called less and they take more time to complete. This means that we can assign a thread to each function and still have a limited number of threads running together.
- Possibility of client/server, distributed architectures: matrices can be easiliy shared (not cells: too small, too many) and functions can be efficently distributed among several processes.
- Better organization: matrices and functions are in a limited number so they can be named, commented, their behaviour can be easily verified.
- Independence by the size of the block: if the matrices sizes change you don't need to change your function, like you normally do in a spreadsheet.