A speed-tatstic way to look up a value? (LUTs)


Results 1 to 13 of 13

Threaded View

  1. #12
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default

    Hank, if it works dont fix it. or if it isn't broke, fix it till it is. lol

    Seriously, the only thing i would do is make sure and run your test from the bottom up. By this I mean, check for the low count first on up th to highest count. then you can be sure to have enough time. . Something else about your linear search, Y only need to test for 1 condition in each next IF after the first. heres why:

    First check establishes a range, say 3800-3900, if this fails, number must be > 3900. next check just needs to look for <4000 cuz you know its >3900. next check if <4200,again because it must be >3900. and so on. Of course my numbers are fictious, but you should get the point. Only checking 1 condition should almost double the execution speed (half the processing).

    the code I posted is not complete, it shows how to go through the levels of searching.
    Last edited by cncmachineguy; - 4th October 2010 at 00:56. Reason: added
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts