This patch and the previous ones fixes the performance issues noted in Bug 587089 – lookup_attribute() takes too much CPU It increases performance for querying attributes by ~15% in my tests.
attribute ids are generated when the attribute hash is initialized. This way we can guarantee that the ids match every time.