in reply to Re: Re: OT: Use Perl wisely and cleverly
in thread OT: Use Perl wisely and cleverly

Limits: Well, the engraving I did on another thread of TheDamian's code took 8 hours of CPU time on a 1.2 GHz processor. That would have been a rediculous amount of CPU usage and RAM just a few years ago.

Back when I first did ray-tracing, I was using a 80286 with no floating point hardware! One time somewhere between that at the '486SX days I wondered about doing a hand-coded machine language version. The response from the group was that it was a waste of time; effort would be better spent on algorithm improvements than on non-portable and probably not maintainable issues.

In my real work, I feel that using an O(n2) algorithm is "wrong" if you can do it n log(n). That is, don't go out of your way to make it super efficient, but don't do something stupid either.

As for the ray-tracing, I think it was so slow because the objects generated from truetype font extrusions are not set up with simple bounding boxes. If I expanded that project, I would look at putting simple boxes around each line of text to early-out a non-intersection.

But it won't stop me from wishing for a faster CPU, or wishing that the program were designed with efficiency in mind in the first place, with respect to the data structures used.

—John

  • Comment on Re: Re: Re: OT: Use Perl wisely and cleverly