Phil Tomson wrote:
> In general I've always seen things speed up when I've writtten C
> extensions.  I usually don't rewrite all of the methods in a class, just
> certain speed critical ones.
>
> In this case I've got a Point class:
> ...
>
> And the results:
> l% ruby point.rb
>   Total time for pure ruby point test: 8.600752
>   ACO_Ext initializing...
>   Total time for extension point test: 6.086567
>
> Using the extension it's 2.6 second _slower_ than the pure Ruby
> implementation!?
>
> Phil

Ruby defines an ID type, it may be a long (not a int) which could cause
breakage on 64bit systems.
If your interested in making the code faster you could use a C struct
and a struct RDATA to represent a point instead of a ruby Object.  This
will save the hash lookups.

-Charlie