From: "Mauricio Fernández" Date: 2002-10-24T01:55:37+09:00 Subject: Re: Things That Newcomers to Ruby Should Know (10/16/02) On Thu, Oct 24, 2002 at 12:39:53AM +0900, William Djaja Tjokroaminata wrote: > Hi batsman, > > Mauricio Fern?ndez wrote: > > I consider the use of '<<' when possible to be nothing but a slight > > optimization which might (or not) prove to make Ruby faster. > > You can do a "incomplete RC" (in fact I think something like that was > > already used in Ruby, somewhere), for the common case where an object is > > referenced only once. If another variable references it, set a "shared > > bit" to 1, and that's it. so you don't have to do complete RC which > > would be expensive. > > If you do "incomplete RC", basically you have to find all the places where > a variable (or another object) may start referring to an object. Do you > have any thought of assessing a "complete RC" implementation? I know that > the amount of work by going from "no RC" to "complete RC" is more than > twice of going from "no RC" to "incomplete RC" as currently Ruby uses > mark & sweep (M&S) gc (and therefore there exist a bunch of > "new" functions but not a complete set of "delete" functions.) > > Well, Python started with RC and then added M&S. Ruby started with M&S > and now the RC is being considered. I don't know which direction is > harder or both are equally as hard. I am just thinking that it will > be very nice if we can select the Ruby gc mode. What I was thinking of isn't really GC, but a rather elaborated COW with some help from the AST interpreter. AFAIK, I'd only have to care about multiple references to the same String, and the only ways I can think of right now are assignment and closures. Are there any other? I plan to learn on Ruby's AST interpretation, as I've been reading other parts of the code w/o any problem, but that one seems quite more complex. > > PS: I'm getting a computer of my own next week, and as I'm gonna have a > > lot of free time, I may try this and other different tricks on Ruby's > > implementation, following my new policy on how to improve Ruby [52838] > > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/52838 > > Good luck on your quest and have fun with your new computer. Having to use the ones from the computer pools sucks, and these german people close them around 7pm. What are they thinking about??? Hopefully in a week I'll be typing messages as this one from my own dorm, and I'll at last be able to do some real work on Ruby :-) -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com Just go ahead and write your own multitasking multiuser os! Worked for me all the times. -- Linus Torvalds