Page 1 of 1
Posted: Sun Jul 24, 2005 6:05 pm
Python scripts is too slow. dna library is also very slow, but faster than python.
I thing, C API for plugins may be faster becouse it can use already loaded blend-file.
Is the faster method exists?
Patcience is an aquired skill
Posted: Sun Jul 24, 2005 10:54 pm
I think that if you changed python to C API you would also have to re-work all the plugins. That seems like a lot of work.
Posted: Mon Jul 25, 2005 12:49 pm
hm.. Why change? Blender has exelent python api, but do not provide access to geometry to C-plugins. So, I talk about adding more usable api to C-plugins, because python is too slow (model with 300000 vertices exports more than 2 days!)
Posted: Mon Jul 25, 2005 7:05 pm
what exporter does take so long? sounds like something is wrong with it (maybe some brute force methods which aren't suited for python or something like that?).
Posted: Tue Jul 26, 2005 8:56 am
ok, if you like python very mach, maybe you want to trash ALL Blender C API and rewrite texture plugins on python (and ignore the low speed)??? I think, C API is the main defect of Blender. Too sad...
Posted: Tue Jul 26, 2005 6:05 pm
sorry, i just tried to be helpful! i have no opinion about improving the c-api...
i have exported 50000 polygon models with python and it took 15 - 30 seconds on my pc!
so 300000 polygons shouldn't take 2 days unless the exporter scales exponentially which would also be a problem in c since c is only 50 - 100 times faster than python. your export would take half an hour in c. sounds like something is wrong there.
but maybe i am just talking nonsense here.
i am no expert on this.
btw. as far as i know there will be python texture plugins.
Posted: Tue Jul 26, 2005 8:24 pm
so, i will rewrite Blender parts to extend c api
PS: python slower much more than 50-100 times. I benchmarks it
Posted: Wed Jul 27, 2005 3:16 pm
"yafray rendering" creates XML file contains all geometry and materials. It works VERY fast! So I rewrite 1 file and add my own file format support to blender yafray's xml generator. Now when I need export model, I chousing "yafray rendering" and seting X-resolution to 4 (minimal value) (if resolution is non-4, it generates XML for yafray). My large model exports ~30 seconds!
But how can I do fast import?...
Posted: Wed Jul 27, 2005 5:06 pm
Python is not __THAT__ slow- make a bug report, give your mesh as an example and obviously the script that ran slow. somebody will look into it
I managed to optimize the obj importer to import a 13 meg obj in 9 seconds.
What are you on about dna being slow too?
Posted: Thu Jul 28, 2005 3:32 pm
very simple example : amounting of 1 million 3d-vectors
0m5.374s - python
0m0.012s - C (not C++)
5.374s / 0.012s ~= 478. So python slower than C by 478 times, isn't it?
So C-plugin should be work with my model ~6 minules (python script works 2 days).
I know that maybe I write not-optimised script (I'm not a python scripter), but interpretated language is always very slow!
I say dna is slow because it works much more slower than Blender itself.
And only one question - WHY Blender do not have good C-API if it written in C/C++ itself??
Posted: Fri Jul 29, 2005 4:02 pm
so your own export script is very slow eh?
I've loaded/saved models with several thousand polygons in less than a minute, I'd blame your script more than I'd blame python.
python isn't blazing fast, but it isn't that slow.
Posted: Sat Jul 30, 2005 11:36 am
There's always the possibility of reading/writing blend files directly (have a look at blend2cs for Crystal Space), to make a straight dump via Python and then process the output with C or write some Python-modules in C for some custom routines you can use in Python. Python will most probably be around so find ways around it instead
Posted: Sun Jul 31, 2005 3:25 pm
The first rule of optimizing is to optimize where you need it. How many times per frame do you export your model-probably none. You probably export one time once you've finished modeling. Take the time that you are waiting for your model to export to get some coffee. I don't think it's a good use of your time to focus on optimizing that piece of the production pipeline.
5.3 seconds for 1 million verts does seem higher than normal. Be sure that you're releasing variables when you're done using them, especially in a loop or you could be eating memory up when you don't need to which could cause you to start using virtual memory which will make any program very slow. Check out the python docs about that.
The DNA library really has nothing to do with it. It's used for how the information is stored on disk so that different architectues can open the same blend file.
My 2 cents,