I tried to edit and delete this topic, and got a confirmation it was deleted, but still there... Hm... Anyways, I will have another go with the Umbraco source myself, to try to find out what can be done, although I'm in deep water doing so. Last time I even failed to get it running.
I tested some more, on all tests I see the second python-macro takes more time to load. Simpler macros not considerably much. I tested with a macro containing only print "x" . There the first instance takes 0,000242 s to load, but the second takes 0,013654 s
But with the import of a class or two the time can be up to 0.5 seconds for the 2nd macro+.
Same goes for a simple Ruby macro aswell. Made a Test.rb with only Puts "yo" and added it five times on one template. 1 time it loads fast, but 2:nd time + takes ~0.07 seconds. For a more complex macro it slows down more, but still only on 2'nd macro, first ones does not have this strange extra load time.
Python macro render slow for macro #2
I have a dlr-macro running in #Umbraco. A single one runs fine. But when I add more than one in the template each one takes ~0.5 seconds.
I found out it's my workaround to add the path to /Python that slows down.
Sadly the workaround is necessary in most scripts to be able to call other scripts due to this issue http://umbraco.codeplex.com/workitem/28473
Would be awesome if some core dev had time to have a look at this.
I didn't notice any problems on the site I recently was building with had at least 3 python macros at any given point
I tried to edit and delete this topic, and got a confirmation it was deleted, but still there... Hm... Anyways, I will have another go with the Umbraco source myself, to try to find out what can be done, although I'm in deep water doing so. Last time I even failed to get it running.
Hi Slace,
I did this to test:
Created a python-macro with the code from my post above.
A simple template with the macro repeated :
Here's what my trace looks like, second and third macro takes 0.3 secs to load (not render as I thought), could it be a cache thing?:
umbracoMacro Macro loaded from cache (ID: 11, Smallmacro) 0,00209104788457751 0,000078
renderMacro Rendering started (macro: Smallmacro, type: 6, cacheRate: 0) 0,00214915582846423 0,000058
umbracoMacro DLR Script script added (smallmacro.py) 0,00221508599556648 0,000066
umbracoMacro Macro loaded from cache (ID: 11, Smallmacro) 0,315366059094103 0,313151
renderMacro Rendering started (macro: Smallmacro, type: 6, cacheRate: 0) 0,315507976572441 0,000142
umbracoMacro DLR Script script added (smallmacro.py) 0,315575024200003 0,000067
umbracoMacro Macro loaded from cache (ID: 11, Smallmacro) 0,604867099030743 0,289292
renderMacro Rendering started (macro: Smallmacro, type: 6, cacheRate: 0) 0,60497605142553 0,000109
umbracoMacro DLR Script script added (smallmacro.py) 0,605034997464762 0,000059
I tested some more, on all tests I see the second python-macro takes more time to load. Simpler macros not considerably much. I tested with a macro containing only print "x" . There the first instance takes 0,000242 s to load, but the second takes 0,013654 s
But with the import of a class or two the time can be up to 0.5 seconds for the 2nd macro+.
Same goes for a simple Ruby macro aswell. Made a Test.rb with only Puts "yo" and added it five times on one template. 1 time it loads fast, but 2:nd time + takes ~0.07 seconds. For a more complex macro it slows down more, but still only on 2'nd macro, first ones does not have this strange extra load time.
is working on a reply...