[vtkusers] VTK CVS + wxPython...
Charl P. Botha
c.p.botha at ewi.tudelft.nl
Fri Jul 23 06:08:19 EDT 2004
Andrea Gavana wrote:
> Mhm... I thought to be immune from C/C++ things. I just switched from Matlab to
> Python because I was impressed by the Python capabilities (and also by the
> speed/easy of use of VTK, that is also fairly well linked with Python). The
> graphic part of Matlab is far poorer than the VTK one (for my applications, at
> least), and with Python there are almost no limits on what you can implement.
> Moreover, the integration of wxWindows in Python was just a charme for me,
> because the last thing on which Matlab could be superior (the GUI building
> process), now is old story. I built some small GUI using Boa Constructor and
> wxPython and I was really satisfied.
> Now, going back from Matlab/Python to C/C++ seems to me like going from the
> Pentium IV (and above) Era to the ENIAC Era... but I can easily make mistakes,
> viewing my lack of experience in Python/C/C++ related things.
Think about this: there is really NO reason for VTK via Python to be
significantly slower than VTK via C++. When I do for instance:
filterA.SetInput(filterA.GetOutput())
filterA.Update()
What do you think happens? That's right, compiled C++ code executes.
When I add actors to a renderer and interact with that renderer, what do
you think happens? That's right, compiled C++ code executes.
The only difference is that I benefit from the extremely dynamic nature
of Python and I can do things at runtime which many C++ programmers have
not yet been able to imagine.
In short: There is little reason for a *well-written* VTK-Python
application to be slower than a VTK-C++ application. Simply keep in
mind that Python is for gluing and C++ is for processing. Also, don't
forget the well-known rule that 20% of your code is responsible for 80%
of your execution time[1], and that is a conservative estimate.
Thanks,
Charl
[1] "Improving software productivity", Barry W. Boehm, "Computer", vol.
20 no. 9, 1987
--
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/
More information about the vtkusers
mailing list