Tristan Hodgson

Person icon, representing my CV Home Github logo Github Envelope icon representing email contact@tristanhodgson.com LinkedIn Logo LinkedIn

Performance Modelling of In-Database Sparse Matrix Multiplication

We benchmark and model matrix multiplication performed entirely inside PostgreSQL against a conventional Python workflow using NumPy. We additionally model a slow 10 Mbps connection by adding a transfer-time penalty to the Python workflow. For dense matrices, NumPy consistently outperforms the SQL approach by a wide margin, and the gap grows with matrix size. For sufficiently sparse matrices, the SQL approach becomes competitive and can be faster, as the database can filter out a large fraction of unnecessary multiplications while also eliminating client-side data transfer. These results suggest in-database multiplication can be advantageous for sparse workloads or constrained network conditions, while dense multiplication remains better suited to NumPy.

Write-up

Presentation on Kolmogorov Complexity

I recently gave an eight minute presentation on Kolmogorov complexity for a varied audience consisting of mathematicians ranging from first year undergraduates to professors. Due to the lack of computer science background of the audience I avoided the formalism of turing machines, to focus the talk on the more mathematically interesting aspects, such as the uncountability of the complexity function. I also illustrated the concept of Normalized Information Distance (NID) using a simple example inspired by the work of Rudi Cilibras and Paul Vitányi, demonstrating how we can use translations of the UN Declaration of Human Rights to reveal relationships between languages .

Download Slides (PDF)