This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch] Rewrite regex matchers


On Fri, 2013-08-30 15:36:03 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> On Fri, Aug 30, 2013 at 03:26:59PM +0200, Paolo Carlini wrote:
> > On 08/30/2013 02:05 PM, Tim Shen wrote:
> > >+      const _TraitsT&                    _M_traits;
> > >+      _FlagT                             _M_flags;
> > >+      bool                               _M_is_non_matching;
> > >+      std::set<_CharT>                   _M_char_set;
> > >+      std::set<pair<_StringT, _StringT>> _M_range_set;
> > >+      _CharClassT                        _M_class_set;
> > another, very general comment: now that nothing is decided ABI-wise
> > for these features, let's pay attention to the layouts, let's make
> > sure that the data members are ordered in the best way to minimize
> > the size. For example, when I see a bool sandwiched between big
> > objects something seems at least weird... Let's make measurements
> > and optimize for 64-bit but let's double check on 32-bit too.
> 
> You could use pahole utility from dwarves for this, though not sure how far
> it is with support for DWARF4 and extensions recent gcc emit, so perhaps you
> need -gdwarf-3 -gstrict-dwarf or similar.

But please keep in mind that size is not everything. Cachelines count,
too! If you save four or eight bytes off of a stackframe (or struct or
whatever), but sacrifice a cacheline or two to access badly layouted
variables in eg. a long-running loop, you even lost performance.

MfG, JBG

-- 
      Jan-Benedict Glaw      jbglaw@lug-owl.de              +49-172-7608481
Signature of:          GDB has a 'break' feature; why doesn't it have 'fix' too?
the second  :

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]