in reply to Re^6: search array for closest lower and higher number from another array
in thread search array for closest lower and higher number from another array

bigbot

I don't think anyone here would tell you that a perl script could/would be faster than a "highly" optimized C program ( I could be wrong ). And there is nothing wrong with using the system command 'grep' to produce your solution.

But if you still want to improve the execution time, some things to look at:

All of these improvements are nice, but is it worth spending the time to debug the improved script to gain 'nn' seconds at execution time. That is your call -- balancing your time efficiency versus the script efficiency. Chapter 24 of The Camel book does an excellent job of explaining the trade-offs.

Good Luck

"Well done is better than well said." - Benjamin Franklin

  • Comment on Re^7: search array for closest lower and higher number from another array
  • Download Code

Replies are listed 'Best First'.
Re^8: search array for closest lower and higher number from another array
by bigbot (Beadle) on Feb 08, 2011 at 01:27 UTC
    Thank you Flex I will certainly look into that book!