cast_graph cache doesn't

Chris Byrne <[email protected]>
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
We've just discovered a problem with the cast_graph cache where the
offset in the key used by m_cache.get is not the same as the one used
by m_cache.put. This typically always results in a cache miss so a
large amount of time is spent walking the cast graph.

Fix is a one word change in the function cache::put in inheritance.cpp:

      m_cache.insert(std::make_pair(
          key_type(src, target, dynamic_id, offset)
        , cache_entry(offset, distance)
      ));

where key_type construction should instead use object_offset:

      m_cache.insert(std::make_pair(
          key_type(src, target, dynamic_id, object_offset)
        , cache_entry(offset, distance)
      ));


Which increased our frame rate greatly.


Thanks,
 Chris Byrne

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.