El dilluns, 12 de gener del 2026, a les 14:08:49 (Hora estàndard d’Europa 
central), Sune Stolborg Vuorela va escriure:
> On Monday, January 12, 2026 1:59:29 PM Central European Standard Time Albert
> Astals Cid wrote:
> > I mean these ones
> > 
> >     int arrayGetLength() const;
> >     void arrayAdd(Object &&elem);
> >     void arrayRemove(int i);
> >     Object arrayGet(int i, int recursion) const;
> >     const Object &arrayGetNF(int i) const;
> > 
> > What do you think?
> 
> My gut feeling is that these helpers has a measurable performance gain.

Both calls are inlined so at the end of the day the compiler is going to 
generate the exact same code?

To check my assumption, i created a Release     build and ran
make poppler/PageLabelInfo.cc.s 
with the current code and changing the PageLabelInfo::parse function to do 
nums.getArray()->getLength() and nums.getArray()->get(i)

Both code generates exactly the same assembler (with gcc).

Cheers,
  Albert

> 
> From a code perspective, I find these helpers weird and would not mind them
> gone, but I can live with them if we gain enough performance from it.
> 
> /Sune




Reply via email to