ywywdh / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

Patch for /trunk/as3/trunk/src/org/papervision3d/objects/parsers/KMZ.as #287

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Summary: Patch related with unnecessary uncompressing of data. 
Benefit: significant decrease of model loading time

Details: 
1 - First change: 
Function getColladaFromZipFile(). In the way it was implemented, all the data 
from the kmz file was being unzipped (including textures) to get the dae file. 
As the objective of the function is just to get the collada file, just the DAE 
file needs to be unzipped. As the function was also loading the textures (and 
not using them later) it was wasting processing time.

2 - Second change: 
Function parse(). In the way it was implemented, for loading the textures all 
data from the kmz file was being unzipped (including the DAE file). As just the 
textures are needed, only them have to be unzipped. As the function was also 
loading the dae file (and not using it later) it was wasting processing time. 

3 - Third change: 
Function numTexturesInZip(). It's is not necessary to unzip data to count how 
many textures are found on the KMZ file. It's just necessary to check the 
entries strings, without unzipping anything.

I made some performance tests on here, and this changes I made on the KMZ class 
decrease significantly the model loading time. For example, a complex model of 
1.6MB initially need about 18 seconds to load. After the modifications it just 
needs about 8 seconds to load.

Original issue reported on code.google.com by raryel.c...@gmail.com on 10 Jun 2012 at 3:16

Attachments: