Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » Interesting advantage of using indices instead of iterators
Interesting advantage of using indices instead of iterators [message #7615] Wed, 10 January 2007 11:52 Go to previous message
mirek is currently offline  mirek
Messages: 14262
Registered: November 2005
Ultimate Member
From alt.comp.lang.c++.moderated:

Jeff Koftinoff wrote:

> My only issue with STL's iterator design is that the pointer-style
> based algorithms make it a lot tougher for the compiler to optimize the
> resulting code, taking advantage of cpu pipelining and parallel
> execution units - especially without having the 'restrict' keyword to
> tell the compiler that the dereferenced iterators are not aliasing
> other variables used within the loop. ie, with array indexing the
> compiler can easily tell that certain lines of code can be
> parallelized, but changing a pointer in the loop makes it very hard on
> the compiler designers to track what optimizations can happen. In my
> code on one platform, I've found I could optimize the loop time from
> 170 clock cycles per iteration down to 10 just by using array indexing
> instead of pointer increments! (TMSC6701 DSP, VLIW)

I had many reasons to avoid iterators, but this one is new to me )

--
Mirek Fidler
U++ team leader. http://www.ultimatepp.org
 
Read Message
Read Message
Read Message
Previous Topic: OSes: request for "advertising" audit
Next Topic: Funny way how to get thread specific id
Goto Forum:
  


Current Time: Fri Jun 27 19:26:03 CEST 2025

Total time taken to generate the page: 0.04793 seconds