The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Minimizing Row Displacement Dispatch Tables

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Minimizing Row Displacement Dispatch Tables Posted: Feb 28, 2005 10:39 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Minimizing Row Displacement Dispatch Tables
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Translated from matz blog, 2005-02-21:

This report is old, but I didn’t know.

For implementing Dynamic Dispatch, the technique that uses the dispatch table like Virtual Table(VTABLE) of C++ is often used in statically-typed language. This is because a statically-typed language has properties such as “fast” and “abundant infomation on compile”.

The above-mentihoned report are written about applying such a dispatch table technique to a dynamically-typed language like Smalltalk. It’s considered about the point how it deals when a class or method is dynamically added.

Novel points are:

  • It compress two dimensional tables(class x selector) to one dimensional one. It sorts a sparse table, and it stores elements in desc order. It uses the offset to get.
  • When compressing the table, though it is usually splitted by class, this report recommends to split by selector. Therefore, the efficiency when updating is up because adding a selector ends only adding a line.
  • When a class is added, it deals by using two or more dispatch tables (fall-back the 2nd table by method_missing). Though a new class is a little slow, it’s possible to gain a whole perfomance. In an idle moment, it restructures dispatch tables.

The effeciency seems to be quite good. However, it may be that this technique is inefficient on like Ruby that has a open class, an existing class can be added the method, by increasing table-restructuring.

I think how to solve it.

Read: Minimizing Row Displacement Dispatch Tables

Topic: XML meets Telephony Previous Topic   Next Topic Topic: Rails 0.10.0: Routing, Web Services, Components, Oracle

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use