RE: [Cheetahtemplate-discuss] Slow on Windows XP
Brought to you by:
rtyler,
tavis_rudd
From: <ms...@oz...> - 2005-06-14 18:45:50
|
Johan Fredrik Øhman said: > Think you might think I'm using the standard cheetah test. > But I'm using my own... > > So I guess you cannot compare the results :) > I included my files below if anybody is interested. I tried this on Linux (Pentium 4, 2.8 GHz) and got: 3.3 seconds with _namemapper.so 6.9 seconds with namemapper.py Twice the time and annoyingly slow, but nowhere near as bad as the Windows sample. I commented the '#for $i in $arrayList' portion of the template and got: 0.23 seconds with _namemapper.so 0.23 seconds with namemapper.py I then commented the loop body but kept the loop and got: 0.25 with _namemapper.so 0.28 with namemapper.py I then uncommented the first <td> in the loop body and got: 1.05 with _namemapper.so 1.97 with namemapper.py What a difference. The row contains of four placeholders: $urllib.quote_plus(i[0]) $i[0] $urllib.quote_plus(i[0]) $i[0][:20] I eliminated the calls to quote_plus and got: 0.54 with _namemapper.so 0.55 with namemapper.py So somehow the presence of the quote_plus call not only adds significantly to the total time, which is expected, but makes namemapper.py perform significantly worse, which is surprising. Any theories, Tavis? You're building the arrayList in the most inefficient way possible, BTW. Maybe that was intentional for the test, but in case it was not: - arrayList is a constant so it can be set before the loop - += and [expression] are inefficient because they build throwaway temporary arrays It's also unorthodox to use the same counter variable for an inner loop as an outer loop. It works here because you don't use the outer 'i' inside the loop. -- -- Mike Orr <ms...@oz...> |