[Bf-python] svg2obj script.

Campbell Barton cbarton at metavr.com
Thu Mar 29 20:11:25 CEST 2007


Martin Poirier wrote:
> --- jmsoler at free.fr wrote:
> 
>> Selon Martin Poirier <theeth at yahoo.com>:
>>
>>> You're sure it's that single if that causes the
>> slow
>>> down?
>>>
>> Nothing else was changed.
> 
> Heh, when you mentionned a slow down, I though you
> meant something more than a 1% slow down on a size 10
> sample with more than 1% variation.
> 
>>> I did some benchmarks with different size strings
>> and
>>> the first version (with the split find) is always
>>> faster.
>>>
>>> But even on large strings, the execution time
>>> difference was between 3.60951423645e-06 and
>>> 5.2826166153e-06 seconds.
>>>
>>> Martin
>> I did the tests in the script itself with a 800kos
>> svg file
>> exported  from Adobe Illustrator.
>>
>> With Blender 2.43 CVS, win32 XP pro, python 2.5,
>> imported objects remain in Blender'memory space.
>>
>> 10 Times without this  modif :
>>  elapsed time :  3.02794895687
>>  elapsed time :  3.02382840209
>>  elapsed time :  3.0483079298
>>  elapsed time :  3.03878685169
>>  elapsed time :  3.08494582747
>>  elapsed time :  3.04972026395
>>  elapsed time :  3.13402334144
>>  elapsed time :  3.15297461674
>>  elapsed time :  3.05711943378
>>  elapsed time :  3.13330760271
>>
>> Average on 10 times  = 3.07509
>> Average on first 5 times   = 3.04474
>>
>> 10 Time with this  modif :
>>  elapsed time :  3.10750422266
>>  elapsed time :  3.07682870892
>>  elapsed time :  3.01555719385
>>  elapsed time :  3.0640956465
>>  elapsed time :  3.06022679437
>>  elapsed time :  3.02146382774
>>  elapsed time :  3.12042855888
>>  elapsed time :  3.11457905378
>>  elapsed time :  3.06329264794
>>  elapsed time :  3.05221140016
>>
>> Average on 10 times = 3.06961, faster but you have
>> to load the same file 3
>> times before to gain something .
>> Average on 5 first times   = 3.06483, slower ...
>>
>> New tests with official Blender 2.43, win32 XP pro,
>> python 2.4,
>> imported objects reamain in Blender's memory space.
>>
>> 10 Times without this  modif :
>>  elapsed time :  2.55757148982
>>  elapsed time :  2.54529198096
>>  elapsed time :  2.55689776832
>>  elapsed time :  2.57920924172
>>  elapsed time :  2.5708110137
>>  elapsed time :  2.58500159065
>>  elapsed time :  2.62151425544
>>  elapsed time :  2.64284499019
>>  elapsed time :  2.58333532894
>>  elapsed time :  2.63685119103
>>
>> Average = 2.5879
>>
>> 10 Time with this  modif:
>>  elapsed time :  2.54051702967
>>  elapsed time :  2.52347233528
>>  elapsed time :  2.5349952355
>>  elapsed time :  2.5584814291
>>  elapsed time :  2.57258579398
>>  elapsed time :  2.576736104
>>  elapsed time :  2.6136939851
>>  elapsed time :  2.61544180995
>>  elapsed time :  2.5731474679
>>  elapsed time :  2.66417633218
>>
>> Average = 2.5773
> 
> The difference is not very meaningful, it is less than
> one standard deviation away in both cases. (I'm not
> going to enter deeper into statistical theories, but
> with a small sample like this, anything can happen on
> both sides)
> 
> Frankly, on this one, I'd say do what you want, but I
> really can't understand how you can figure that doing
> the lookup twice is better than once, even if the
> difference is minimal / non meaningful.
> 
> Martin

Such small difference in time dosnt realy prove much, your computer 
might have been doing some minor task to sway it either way.

agree with Martin, do what you want but the most logical is to do less 
lookups since its not significantly slower.



More information about the Bf-python mailing list