lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Sep 29, 2009 at 9:32 PM, Mark Feldman
<mfeldman@infinite-interactive.com> wrote:
> After behaviour, my secondary objective has been code maintainability...I've
> generally kept the port line-by-line as close to the original code as
> possible so that future patches and upgrades can be easily applied.
> Unfortunately this strategy seriously affects performance, even with full
> optimizations enabled. The original code makes judiscious use of the
> template processor and since C# doesn't have a preprocessor these have had
> to be replaced with static internal/private member functions, which is
> exactly what you don't want in the type of performance-critical code that
> it's being used for. Sometimes the C# optimizer performs well, often it
> doesn't!

Have you considered preprocessing the code with a macro processor? You
keep the maintainability of the original source being close to final,
and if avoiding function call overhead helps that much, you get the
performance improvement.

Sam