Re: HashTable
Dennis Myrén wrote:[color=blue]
> Thank you, Helge.[/color]
No problemo.
[color=blue]
> I have done all changes you suggested except in get_Values.[/color]
Don't accept my advice as definitive, run your benchmarks and see if
things change, and in what direction :)
Optimizing code-structure to suit the compiler is often a guessing-game.
For example I wrote 4 different implementations of an interpreter for a
small language: iterative, recursive and
multiple-tailrecursive-functions(passi ng the state in an "accumulato r"),
which was the fastest do you think?
HINT: gcc and MSVC6 produced the fastest code on one of them, MSVC7 on
another.
[color=blue]
> The reason of the Add method of signature:
> Add ( ref int, ref int, bool )
> is that it is a private method used internally only.
> I use ref to prevent a copy of the Int32 being made, doing what i can to
> gain performance.[/color]
Off the top of my head I would doubt that you are getting any benefit
from the ref's, Does your benchmarks show a performance gain from it?
--
Helge
Dennis Myrén wrote:[color=blue]
> Thank you, Helge.[/color]
No problemo.
[color=blue]
> I have done all changes you suggested except in get_Values.[/color]
Don't accept my advice as definitive, run your benchmarks and see if
things change, and in what direction :)
Optimizing code-structure to suit the compiler is often a guessing-game.
For example I wrote 4 different implementations of an interpreter for a
small language: iterative, recursive and
multiple-tailrecursive-functions(passi ng the state in an "accumulato r"),
which was the fastest do you think?
HINT: gcc and MSVC6 produced the fastest code on one of them, MSVC7 on
another.
[color=blue]
> The reason of the Add method of signature:
> Add ( ref int, ref int, bool )
> is that it is a private method used internally only.
> I use ref to prevent a copy of the Int32 being made, doing what i can to
> gain performance.[/color]
Off the top of my head I would doubt that you are getting any benefit
from the ref's, Does your benchmarks show a performance gain from it?
--
Helge
Comment