I'm new to Slick and I've tried a little proof-of-concept of Play2 application with Slick 3.0
My goal was to compare the performance of the new Slick API with a plain JDBC prepared statements.
The database I used was PostgreSQL 9.4 with ~ 10000 records in the main table, running in my localhost.
I've added REST API endpoints to this application for Slick 3.0 (v1) and plain JDBC (v2), so for example
GET /api/v1/employees controllers.EmployeeControllerSlick.list(p:Int ?= 0, s:Int ?= 2, f ?= "") // uses a Slick API
GET /api/v2/employees controllers.EmployeeControllerJdbc.list(p:Int ?= 0, s:Int ?= 2, f ?= "") // uses plain JDBC
With all different settings (number of concurrent threads, with/without connection pool, different connection pool settings JDBC performance is always better.
With 500 concurrent threads JDBC is ~ 25% faster (see attachment). Moreover, with 2000 concurrent threads error rate of Slick API is ~40% but JBDC has around 2.5%
Maybe I'm doing something wrong - I'll be happy if you point it out.
The reason I'm doing this is the advertisement of a new reactive concept claims that all calls to external systems are done asynchronously, meaning that the thread should not be blocked on waiting for external system to complete, while in JDBC calls the thread is used until it finishes the execution. Ultimately it should give some performance win for reactive system, but I don't see it in my case.
Thanks in advance.