From: Kent Dahl Date: 2001-12-01T16:58:11+09:00 Subject: [ruby-talk:27163] Statically linked extensions and deferred initialization. Hi. As I understand extinit.c, all statically linked extensions are initialized when starting Ruby. As the numbers of extensions I compile in increases, so does both the startup time and the total memory footprint of Ruby. Unfortunately, I haven't been able to get dynamically loaded extensions to work for the platform in question, (mipsel-linux Agenda VR3) but that solution would have others platform specific negative sides anyway. So, I've begun thinking about deferred initialization. The most transparant solution would be to make some map structure in extinit.c that maps the .so filenames (which get required, but doesn't exist), to the Init_[extname], and then look up in this if require fails. Are there any pitfalls I should be wary of? I don't want to go meddling too much inside the C code of the require method, but I need this to be transparent, i.e. the scripts should not need additional or changed require statements. Oh, and this might be a nice thing to have in the Ruby proper too, maybe as an option? -- <[ Kent Dahl ]>================<[ http://www.stud.ntnu.no/~kentda/ ]> )____(stud.techn.;ind.�k.data)||(softwareDeveloper.at(Trustix))_( /"Opinions expressed are mine and not those of my Employer, "\ ( "the University, my girlfriend, stray cats, banana fruitflies, " ) \"nor the frontal lobe of my left cerebral hemisphere. "/