Opened 3 years ago

Closed 3 years ago

#2192 closed defect (done)

Discovering of StoreableHooks is not cached

Reported by: mkommend Owned by: mkommend
Priority: highest Milestone: HeuristicLab 3.3.10
Component: Persistence Version: 3.3.9
Keywords: Cc: bburlacu

Description

There exists a code in the StorableSerializer for discovering the StoreableHooks per type and after discovering this information is stored in a dictionary hookCache to allow its reuse when the type is encountered again and thus skipping the reflection code.

The problem is that the key for this dictionary is the class HookDesignator, which does not overload equals and getHashcode properly (hence a reference comparison is performed) and therefore an already discovered hook is never detected in the dictionary and the reflection code is invoked everytime.

An easy solution for this issue would be to derive HookDesignator from Tuple<Type,HookType>.

Change History (6)

comment:1 Changed 3 years ago by bburlacu

  • Cc bburlacu added

comment:2 Changed 3 years ago by epitzer

  • Status changed from new to accepted

comment:3 Changed 3 years ago by epitzer

r10958 make StorableSerializer.HookDesignator derive from Tuple and inherit proper Equals() and GetHashCode()

comment:4 Changed 3 years ago by epitzer

  • Owner changed from epitzer to mkommend
  • Status changed from accepted to reviewing

comment:5 Changed 3 years ago by mkommend

  • Status changed from reviewing to readytorelease

Reviewed r10958.

comment:6 Changed 3 years ago by mkommend

  • Resolution set to done
  • Status changed from readytorelease to closed

r11143: Merged r10958 into stable.

Note: See TracTickets for help on using tickets.