From: Ryan Davis Date: 2005-04-05T06:59:42+09:00 Subject: Re: Extension question On Apr 4, 2005, at 10:54 AM, Joe Van Dyk wrote: > And to expand the question... > > I'm using the GD library to create the image. I'm creating the image > by reading binary data from a file and looping through some > predetermined width and height and setting each pixel of the picture > based on the data from the file. > > Which parts of this should go in the C extension and which parts > should stay Ruby? I'm really scratching my head over this one. Here is what we suggest in the readme of ruby inline: ** PROFILING STRATEGY: 0) Always keep a log of your progress and changes. 1) Run code with 'time' and large dataset. 2) Run code with '-rprofile' and smaller dataset, large enough to get good #s. 3) Examine profile output and translate 1 bottleneck to C. 4) Run new code with 'time' and large dataset. Repeat 2-3 if unsatisfied. 5) Run final code with 'time' and compare to the first run.