← Back to team overview

dolfin team mailing list archive

Re: [Bug 668862] Re: Sparsity pattern computation dead slow with 'real' spaces

 

On Tue, Nov 30, 2010 at 10:07:21PM +0000, Garth N. Wells wrote:
>
>
> On 30/11/10 22:05, Anders Logg wrote:
> >On Tue, Nov 30, 2010 at 07:08:07PM +0100, Martin Sandve Alnæs wrote:
> >>I haven't looked at the code, but just some general STL advice:
> >>- Never use std::find on map and set types in stl, use their member
> >>function find instead. std::find could be a linear search in this
> >>case...
> >>- Don't use the [] operator to read elements from maps and sets, use
> >>mymap.find instead.
> >
> >When we're on this topic, we should avoid using std::set entirely.
> >Using std::vector+std::find+push_back is much faster than
> >std::set+insert as I found out when I optimized the topology
> >computation a couple of days back.
> >
>
> We call this 'dolfin::Set' ;) (dolfin/common/Set.h)

Shows how much I paid attention to the addition of that class. :-)

--
Anders



References