From: edw...@yandex.ru
> 
> The problem is that I did this benchmarking before. Actually, the code 
> snippets above are run in 
> a very long cycle, and if we have "foreach" statement, then we need to store 
> some value for loop iteration and 
> even one assignment of this variable consumes time significantly in my case 
> (around several seconds in the whole). So, I ended
> up with solution with unfolding, but as I have mentioned I do not want to do 
> it manually.

Could you show us some more of the code? Maybe we can suggest a 
better optimization. Your "we need to store some value for loop 
iteration" sounds a bit strange.

I would understand the request if the list of the items to loop 
through was static and the unfolding allowed the optimizer to remove 
some branches of code or compute something at compile-time. But it 
sounds as if you compute something repeatedly while you should 
compute it upfront and reuse the value.

Jenda
===== je...@krynicky.cz === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to