Terrier Core

Examine IterablePosting interface from context of efficiency code

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 3.0
  • Component/s: .structures
  • Description:
    Nicola had to change the IterablePosting interface for use in the efficiency code. These changes need to be integrated with core, but may involve changes in various places.

Activity

Hide
Craig Macdonald added a comment - 26/Jan/10 1:19 PM

The major change seems to be

interface IterablePosting
{
  /** Return true if found another posting */
  public boolean next();
  /** Return id of the current posting */
  public int getId();
}

became

interface IterablePosting
{
  public final int EOL = -1;
  /** Return docid if found another posting, EOL otherwise */
  public int next();
  /** Return id of the current posting */
  public int getId();
}

I.e. next() method changes from returning boolean to returning docid if posting found, EOL if end of postings.

This reduced one method call (i.e. next() then getId()) in many cases.

Does anyone have an objections to this change being made?

Show
Craig Macdonald added a comment - 26/Jan/10 1:19 PM The major change seems to be
interface IterablePosting
{
  /** Return true if found another posting */
  public boolean next();
  /** Return id of the current posting */
  public int getId();
}
became
interface IterablePosting
{
  public final int EOL = -1;
  /** Return docid if found another posting, EOL otherwise */
  public int next();
  /** Return id of the current posting */
  public int getId();
}
I.e. next() method changes from returning boolean to returning docid if posting found, EOL if end of postings. This reduced one method call (i.e. next() then getId()) in many cases. Does anyone have an objections to this change being made?
Hide
Craig Macdonald added a comment - 29/Jan/10 3:56 PM

Fixed, for CORE and all other packages.

Show
Craig Macdonald added a comment - 29/Jan/10 3:56 PM Fixed, for CORE and all other packages.

People

Dates

  • Created:
    02/Oct/09 2:54 PM
    Updated:
    05/Mar/10 5:09 PM
    Resolved:
    29/Jan/10 3:56 PM