[vtkusers] Import time in Python

Andrea Borsic aborsic at ne-scientific.com
Thu Aug 18 04:33:25 EDT 2016


Hi Andrea,

In my experience this is not uncommon on (modern) Windows computers if 
many installed applications have added their paths to the system path in 
front of the VTK DLLs path. Windows will test many directories searching 
for the DLLs it needs to load.

Typing "SET" from command line should show you where VTK is in the path. 
Windows adds the user path at the end of the system path, so if VTK was 
manually added to the user path, it might be likely at the very end of a 
long list of other paths.

The utility Process Monitor 
(https://technet.microsoft.com/en-us/sysinternals/bb896645) can also be 
used to see all the tests/searches the system will perform during 
"import vtk"

I hope this might help,

Best Regards,

Andrea



On 17-Aug-16 5:17 PM, Andrea Gavana wrote:
> Hello,
>
>      I have recently installed VTK 7.0 to be used via Python 2.7 using 
> the excellent resources from Christoph Gohlke 
> (http://www.lfd.uci.edu/~gohlke/pythonlibs/ 
> <http://www.lfd.uci.edu/%7Egohlke/pythonlibs/>). I have a considerably 
> powerful machine at work - 96 GB RAM, 8 cores, 64 bit Windows 7 
> Enterprise. However, executing the simple command below:
>
> import vtk
>
> takes more than 7 seconds on this machine. I understand that there are 
> quite a few modules to import in the VTK hierarchy, but I was not 
> expecting such a dramatically slow operation. I also understand that 
> this may not be the perfect forum to post such a question, but maybe 
> someone else has encountered a similar behavior and he/she has some 
> explanation for it.
>
> Any suggestion is more than welcome, thank you in advance. I paste 
> below the results of profiling the simple import statement using the 
> Python profiler in this way:
>
> python -m cProfile test_import_vtk.py
>
>
> Andrea.
>
>
> *File Name                  Import Time (seconds)*
> vtkIOImage.py              0.190
> vtkIOExodus.py               0.151
> vtkCommonCore.py               0.147
> vtkRenderingOpenGL2.py               0.124
> vtkRenderingFreeType.py              0.120
> vtkIOInfovis.py              0.113
> vtkIOParallel.py               0.106
> vtkIONetCDF.py               0.103
> vtkCommonColor.py              0.102
> vtkFiltersStatistics.py              0.101
> vtkFiltersVerdict.py               0.100
> vtkGeovisCore.py               0.100
> vtkIOAMR.py              0.100
> vtkIOXMLParser.py              0.099
> vtkIOMovie.py              0.097
> vtkCommonDataModel.py              0.096
> vtkCommonMath.py               0.091
> vtkCommonMisc.py               0.091
> vtkInteractionWidgets.py             0.091
> vtkRenderingVolume.py              0.090
> vtkCommonComputationalGeometry.py    0.088
> vtkFiltersModeling.py              0.087
> vtkIOMINC.py               0.087
> vtkIOSQL.py              0.087
> vtkInfovisCore.py              0.087
> vtkFiltersHybrid.py              0.085
> vtkIOPLY.py              0.085
> vtkFiltersCore.py              0.084
> vtkImagingGeneral.py               0.084
> vtkRenderingLabel.py               0.083
> vtkImagingMath.py              0.082
> vtkInfovisLayout.py              0.082
> vtkCommonExecutionModel.py           0.081
> vtkIOCore.py               0.081
> vtkFiltersGeneric.py               0.080
> vtkIOEnSight.py              0.080
> vtkViewsContext2D.py               0.080
> vtkFiltersAMR.py               0.079
> vtkFiltersParallelImaging.py         0.079
> vtkImagingCore.py              0.079
> vtkImagingFourier.py               0.079
> vtkInteractionImage.py               0.079
> vtkInteractionStyle.py               0.079
> vtkRenderingContext2D.py             0.079
> vtkImagingColor.py               0.078
> vtkRenderingImage.py               0.078
> vtkRenderingVolumeOpenGL2.py         0.078
> vtkFiltersPython.py              0.077
> vtkIOParallelXML.py              0.077
> vtkImagingStatistics.py              0.077
> vtkViewsInfovis.py               0.077
> vtkFiltersSources.py               0.076
> vtkIOVideo.py              0.076
> vtkFiltersFlowPaths.py               0.075
> vtkFiltersParallel.py              0.075
> vtkFiltersSMP.py               0.075
> vtkFiltersSelection.py               0.075
> vtkIOImport.py               0.075
> vtkImagingHybrid.py              0.075
> vtkRenderingAnnotation.py            0.075
> vtkDomainsChemistry.py               0.073
> vtkFiltersImaging.py               0.073
> vtkRenderingCore.py              0.073
> vtkIOExport.py               0.072
> vtkIOLegacy.py               0.072
> vtkRenderingContextOpenGL2.py        0.072
> vtkCommonTransforms.py               0.071
> vtkFiltersGeneral.py               0.071
> vtkIOLSDyna.py               0.071
> vtkImagingMorphological.py           0.071
> vtkImagingStencil.py               0.071
> vtkIOXML.py              0.070
> vtkImagingSources.py               0.070
> vtkFiltersGeometry.py              0.069
> vtkFiltersHyperTree.py               0.069
> vtkFiltersProgrammable.py            0.069
> vtkCommonSystem.py               0.068
> vtkParallelCore.py               0.067
> vtkDomainsChemistryOpenGL2.py        0.066
> vtkFiltersExtraction.py              0.066
> vtkRenderingLOD.py               0.065
> vtkFiltersTexture.py               0.063
> vtkViewsCore.py              0.061
> vtkChartsCore.py               0.060
> vtkIOGeometry.py               0.059
>
> *Total                  7.119*
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers

-- 
++++++++++++++++++++++++++++++++++++
Andrea Borsic Ph.D.
CEO & Founder NE Scientific LLC
Tel: +1 603 676 7450
Web: www.ne-scientific.com
Twitter: https://twitter.com/ne_scientific

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160818/60a4afc3/attachment.html>


More information about the vtkusers mailing list