You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[improvment] how fast do you guys want your code?? #663
looked through the code trying to figure out what used numpy and puked a few times.
your code is so pythonic (slow).
for example, do you know what the fastest method of type-checking is??
isinstance() is the slowest, and no type() isn't the answer, try something more direct.
give up? the answer is object.__class__, which is as fast as type-referencing gets.
I havn't played with setattr() and getattr() to know too much about them, I generally work in the python backend and work my magic there...
I can take a wild guess though that they're about as slow as a double-recursed function.
I'll give credit where due though...
due to the usage of the code, it's only ran once, and I've seen, and even written worse code.
hopefully in time the code will be improved...
(just because it's used for loading doesn't mean it should be slow as heck)
PyAssimp has no current maintainer that I'm aware of, it's all more of less assorted pull requests.
Some nits though
isinstance()
isinstance is readable, and it caters for inheritance.
setattr, getattr
They're builtins and (afaik) as fast as you can get. They only exhibit double-recursive behaviour if you use them to implement Ackermann's function :-)
I've seen, and even written worse code.
Now, you just volunteered yourself! :-)
I would've suspected that the main cost comes from copying all the memory over and over again. Assimp's data structure incurs lots of small allocations. We need to profile things for more insights.
Activity
kimkulling commentedon Oct 8, 2015
Thanks for the feedback. Do you have some hotspots?
acgessler commentedon Oct 8, 2015
PyAssimp has no current maintainer that I'm aware of, it's all more of less assorted pull requests.
Some nits though
isinstance is readable, and it caters for inheritance.
They're builtins and (afaik) as fast as you can get. They only exhibit double-recursive behaviour if you use them to implement Ackermann's function :-)
Now, you just volunteered yourself! :-)
I would've suspected that the main cost comes from copying all the memory over and over again. Assimp's data structure incurs lots of small allocations. We need to profile things for more insights.
kimkulling commentedon Oct 28, 2015
Any updates? If yes, just please reopen this issue. I have this on my lists of todos.
Update CMakeLists.txt
Update CMakeLists.txt (#5379)
Update CMakeLists.txt (#5379)