Performance

First, benckmarks are always wrong! Do not take the data in this page at face value. They only show that, on the benchmarked system, in a fairly diverse number of case, WKB4J is much, much faster than the native data reader. So I encourage you to run your own benchmarks (and feel free to tell me about your results, good or bad).

The benchmarks are run using the tgr08059lkA shapefile. It contains 33862 MultiLineString records. This shapefile is available in the test dataset. It come from the US census dataset, so I think that it is fairly representative of common shapefiles. As usual, your mileage may vary: you should perform your own tests.

OpenMap

In this configuration, WKB4J is about 14 times faster than the native OpenMap reader.

Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 72064 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 75323 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 70853 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 70972 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 72627 ms
Run time for testOpen MapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 70284 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 70243 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 73915 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 70753 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 82722 ms
Run time for testOpenMapFactoryWithWKT(org.wkb4j.test.openmap.OpenmapPerformanceTest): 69884 ms
Average runtime:72757
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 3918 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 3932 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 4451 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 4571 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 6881 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 6388 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 4885 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 4465 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 5168 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 4587 ms
Run time for testOpenMapFactory(org.wkb4j.test.openmap.OpenmapPerformanceTest): 4134 ms
Average runtime:4946

Postgis

In this configuration, WKB4J is 15 times faster than the native Postgis reader.

Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 73988 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 81088 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 75253 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 75945 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 74523 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 72365 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 73710 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 74742 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 71304 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 73432 ms
Run time for testPostGISFactoryWithWKT(org.wkb4j.test.postgis.PostgisPerformanceTest): 76559 ms
Average runtime:74892
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 6181 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4903 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4801 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4744 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4784 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4739 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4795 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4746 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4543 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4740 ms
Run time for testPostGISFactory(org.wkb4j.test.postgis.PostgisPerformanceTest): 4784 ms
Average runtime:4757

JTS

In this configuration, WKB4J is 23 times faster than the native JTS reader.

Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 113798 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 113012 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 112748 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 114201 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 112644 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 112842 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 120648 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 113474 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 115216 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 113594 ms
Run time for testJTSFactoryWithWKT(org.wkb4j.test.jts.JTSPerformanceTest): 112875 ms
Average runtime:114125
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 7985 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 5706 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 51 72 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 5686 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 7271 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 4552 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 4440 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 4459 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 4435 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 4489 ms
Run time for testJTSFactory(org.wkb4j.test.jts.JTSPerformanceTest): 4247 ms
Average runtime:5045

Testing platform

Tests were performed with the following configuration:

SuSE Linux 8, kernel 2.4.18
Athlon 1700XP
512M of DDR 2100 ECC Registered
Swap 700M
2 IBM Deskstars 7200tr/min in RAID1 (mirroring)
Sun JDK 1.4.2
PostgreSQL 7.3.3 (compiled from source)
PostGIS 0.7.5 patched
The WKB4J test and the Postgis database were on the same host. The JVM was not tuned using any runtime option