dolfin team mailing list archive
-
dolfin team
-
Mailing list archive
-
Message #20324
Re: [Bug 668862] Re: Sparsity pattern computation dead slow with 'real' spaces
On Tuesday November 30 2010 10:08:07 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...
I do not think we do that. Default in DOLFIN we use a home brewed Set, which
basically is a std::vector with set functionality. Set::insert used alot of
time when global dofs where inserted as std::find was called on a std::vector
each time.
Using a boost::unordored_set instead of dolfin::Set more or less removed that
bottle neck. Garth has implemented a typedef switch so a user can deside which
container he want to use, dolfin::Set, std::set, boost::unordered_set. Afaik,
each has its advantages and disadvantages.
Johan
References