3 Aug
2004
3 Aug
'04
9:37 a.m.
On Mon, 2 Aug 2004, bulia byak wrote:
I found that Inkscape runs 6% to 7% faster if I replace in nr-point.h
Coord operator[](unsigned i) const throw(std::out_of_range) { if ( i > Y ) { throw std::out_of_range("index out of range"); } return _pt[i]; }
with
inline Coord operator[](unsigned i) const { return _pt[i]; }
and the same for non-const version. I think it's safe to get rid of the range check because the indices are never calculated and are extremely unlikely to go off limits. So if nobody objects I will commit this change.
I'd have no problem with that commit. How are you benchmarking the speed-up? It might be worth unwrapping the loops in that file, as well.
Carl