On Thu, Jun 15, 2006 at 01:20:47PM +0200, [EMAIL PROTECTED] wrote: > Quoting Jean-Marc Lasgouttes <[EMAIL PROTECTED]>: > > > >>>>> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes: > > > > Abdelrazak> Searching in the font info cache is expensive. So, it > > Abdelrazak> could be either the searching of the font info in the > > Abdelrazak> 4-dimensional C-array or the searching in the font width > > Abdelrazak> map. > > > > There is no search in the 4-dim array, it is pure indexing. What is > > more expensive is the map. > > But Andre said that he used the reference to a pointer explicitely to avoid to > call this index twice because it showed under gprof... > > I know that indexing an array should be cheap but a 4-d array, who knows...
Well, accessing the same index twice is obviously more expensive as accessing the index just once. That's why we use the '*& trick'. Accessing a four dimensional C array should be a lot faster than accessing an item in a map with more than a dozen entries or so. Andre'