1. A method for allocating a plurality of programmable comparison operations for use in packet processing operations in a packet switching device based on a plurality of matching definitions, the packet switching device comprising one or more comparison evaluators configured to evaluate an input value with one or more of the plurality of programmable comparison operations in order to generate and provide one or more values representing results of said evaluations to one or more associative memories for use in identifying said packet processing operations, the method comprising: determining a cost reflective of a number of associative memory entries required to represent each particular comparison operation of a plurality of comparison operations, wherein the plurality of comparison operations are identified from the plurality of matching definitions; processing said determined costs of the plurality of comparison operations in order to identify a plurality of higher-cost comparison operations of the plurality of comparison operations; and programming each of said identified higher-cost comparison operations into one of said programmable comparison operations of said comparison evaluators.