in reply to Re^2: Ampersands and sub speed
in thread Ampersands and sub speed

But sometimes there's just no getting around calling a function or a method.

And you're trying to run more than 1.4 million method calls per second?

Update: I guess running one method call per byte, this would limit you to 1.4MB/s. Which isn't really all that bad, but could be a problem, I guess. I think it would be more fruitful to redesign the code not to call a method for every byte than it would to try and use a faster type of call, though.

Replies are listed 'Best First'.
Re^4: Ampersands and sub speed
by creamygoodness (Curate) on Oct 14, 2005 at 22:23 UTC

    Say you have an index with a million documents in it. Someone searches for a term that hits 300,000 of them. Calculating the score for each one of them in Java Lucene might involve several tens of method calls. Now imagine a search with 5 terms. This stuff adds up.

    --
    Marvin Humphrey
    Rectangular Research ― http://www.rectangular.com