Re: patch: inlining

From: J.M. Maurer <j.m.maurer_at_student.utwente.nl>
Date: Thu Dec 30 2004 - 17:08:32 CET

Op do, 30-12-2004 te 13:09 +0100, schreef Jordi Mas:
> Hello,
>
> I have been using a profiler with Abiword. I think that make sense to inline
> the following functions. Are you guys OK with this?

I don't have something sensible to say about the rest of the functions,
but for "getZoomPercentage", DEFINATELY... i've been seen it come up in
the profiles i was doing recently over and over again.

Marc

> plain text document bijlage (diff.txt)
> ? diff.txt
> ? win/vc60.pdb
> ? win/vc70.pdb
> ? xp/vc60.pdb
> ? xp/vc70.pdb
> Index: win/gr_Win32USPGraphics.cpp
> ===================================================================
> RCS file: /cvsroot/abi/src/af/gr/win/gr_Win32USPGraphics.cpp,v
> retrieving revision 1.57
> diff -u -r1.57 gr_Win32USPGraphics.cpp
> --- win/gr_Win32USPGraphics.cpp 28 Dec 2004 10:09:42 -0000 1.57
> +++ win/gr_Win32USPGraphics.cpp 30 Dec 2004 12:08:16 -0000
> @@ -112,9 +112,9 @@
> public:
> virtual ~GR_Win32USPItem(){};
>
> - virtual GR_ScriptType getType() const {return (GR_ScriptType) m_si.a.eScript;}
> - virtual GR_Item * makeCopy() const {return new GR_Win32USPItem(m_si);} // make a copy of this item
> - virtual GRRI_Type getClassId() const {return GRRI_WIN32_UNISCRIBE;}
> + inline virtual GR_ScriptType getType() const {return (GR_ScriptType) m_si.a.eScript;}
> + inline virtual GR_Item * makeCopy() const {return new GR_Win32USPItem(m_si);} // make a copy of this item
> + inline virtual GRRI_Type getClassId() const {return GRRI_WIN32_UNISCRIBE;}
>
> bool isRTL() const {return m_si.a.fRTL != 0;}
>
> Index: xp/gr_Graphics.cpp
> ===================================================================
> RCS file: /cvsroot/abi/src/af/gr/xp/gr_Graphics.cpp,v
> retrieving revision 1.143
> diff -u -r1.143 gr_Graphics.cpp
> --- xp/gr_Graphics.cpp 22 Dec 2004 21:44:14 -0000 1.143
> +++ xp/gr_Graphics.cpp 30 Dec 2004 12:08:19 -0000
> @@ -358,10 +358,6 @@
> m_iFontAllocNo = 0xffffffff;
> }
>
> -UT_uint32 GR_Graphics::getZoomPercentage(void) const
> -{
> - return m_iZoomPercentage;
> -}
>
> const char * GR_Graphics::invertDimension(UT_Dimension dim, double dValue) const
> {
> Index: xp/gr_Graphics.h
> ===================================================================
> RCS file: /cvsroot/abi/src/af/gr/xp/gr_Graphics.h,v
> retrieving revision 1.139
> diff -u -r1.139 gr_Graphics.h
> --- xp/gr_Graphics.h 25 Oct 2004 20:18:03 -0000 1.139
> +++ xp/gr_Graphics.h 30 Dec 2004 12:08:21 -0000
> @@ -492,7 +492,7 @@
> virtual GR_Graphics::Cursor getCursor(void) const = 0;
>
> virtual void setZoomPercentage(UT_uint32 iZoom);
> - UT_uint32 getZoomPercentage(void) const;
> + inline UT_uint32 getZoomPercentage(void) const {return m_iZoomPercentage; }
> static UT_uint32 getResolution(void) { return UT_LAYOUT_RESOLUTION; }
> inline void setPortrait (bool b) {m_bIsPortrait = b;}
> inline bool isPortrait (void) const {return m_bIsPortrait;}
Received on Thu Dec 30 17:03:37 2004

This archive was generated by hypermail 2.1.8 : Thu Dec 30 2004 - 17:03:38 CET