cast_graph cache doesn't

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

cast_graph cache doesn't

Chris Byrne-6
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
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user
Reply | Threaded
Open this post in threaded view
|

Re: cast_graph cache doesn't

Daniel Wallin
On Fri, Jun 25, 2010 at 12:49:17PM -0700, Chris Byrne wrote:
> 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.

Good catch! Applied on 0.9 branch. Thanks!

--
Daniel Wallin
BoostPro Computing
http://www.boostpro.com

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
luabind-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/luabind-user