Java API for KML - Performance[ Performance ] [ The size of the output file in megabytes ] [ Results for part 1 ( create) ] [ Results for part 2 ( marshal) ] [ Results for part 3 ( unmarshal) ]
PerformancePerformance measurements were carried out on a 2.66Ghz MacBook Pro with a 1066MHz frontside bus, 4GB (two 2GB SO-DIMMs) of 1066MHz DDR3 SDRAM, and a NVIDIA GeForce 9400M graphics processor with 256MB of DDR3 SDRAM shared with main memory. JAK was tested with Java 1.5 and Java 1.6. The next listing attempts to be as simple as possible in showing how the performance of JAK was measured. It creates a LinerRing with N coordinates (N ∈ 1, 5, 10, 50, 100, 500, 1000, 5000, 10000, 50000, 100000, 500000, 1000000, and 5000000). Figure 4.5 1 shows the expansion of the file size. Once using Coordinate's double constructor and once using Coordinate's 'String' constructor. Listing 1: Performance test program. Creates N coordinates. // measure _create_ (START) final Kml kml = new Kml(); final Document document = kml.createAndSetDocument().withName("StressTest"); final Placemark p = document.createAndAddPlacemark().withName(filename); final LineString ls = p.createAndSetLineString().withTessellate(true); final List<Coordinate> coords = ls.createAndSetCoordinates(); for (int i = 0; i < N; i++) { coords.add(new Coordinate ( [double | string ] )); } // measure _create_ (STOP) // measure _marshal_ (START) kml.marshal(new File("file.kml"), false); // measure _marshal_ (STOP) // measure _unmarshal_ (START) Kml.unmarshal(new File("file.kml "), false); // measure _unmarshal_ (STOP) The test is composed of three different parts with the performance of each part measured separately:
The times shown are always the average value taken from three test runs.
The size of the output file in megabytesFigure 1: The size of the output file in megabytes.Results for part 1 (create)(as seen in Listing 1) Figure 2: The fewer seconds needed, the faster the test is. The 'double' constructor is significantly faster than the 'String' constructor. Java 1.6 is approximately twice as fast as Java 1.5 using the 'String' constructor. Java 1.5 and Java 1.6 both have a similar runtime behavior when using the 'double' constructor.Results for part 2 (marshal)(as seen in Listing 1) Figure 3: The fewer seconds needed, the faster the test is. Java 1.6 is approximately twice as fast as Java 1.5 at marshalling the object graph into a file.Results for part 3 (unmarshal)(as seen in Listing 1) Figure 4: The fewer seconds needed, the faster the test is. Java 1.6 is a bit faster than Java 1.5 at unmarshalling a file into an object graph. |
Java API for KML | @Google |










is the OpenSource platform of 