Search code examples
sql-serverjtds

Why is JTDS faster than Microsoft JDBC driver?


we're comparing JTDS and Microsoft SQL Server for a Java EE application running on JBoss and we're finding that JTDS is from 30% to 50% faster, benchmarking the application in a high concurrence scenario and keeping exactly the same HW/SW but changing only the driver in the datasource configuration.

While we've seen a lot of favorable options towards JTDS and so we're thinking to go for it I'm still curious:

  • Why is the JTDS driver so much faster?
  • Why Microsoft never updated its driver to be fast as JTDS?

Comparison was made using the latest JDBC 3.0 version and the latest JTDS version and using a SQL Server 2008 running on a 16 core installation with dedicated SAN.


Solution

  • I've done similar performance comparisons, with similar results.

    There are many potential reasons for performance differences. Some of them are visible in the T-SQL generated by the driver, which you can see with SQL Profiler. Other aspects are more subtle, such as connection management and how the underlying protocol (TDS) is implemented.

    I can't say for sure why MS has never updated their driver, but I suspect that part of it is because Java is considered to be a competitive product/platform.