Results 1 to 9 of 9

Thread: [RESOLVED] I'm Looking For A List Of Most Efficient Algorithms

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2013
    Posts
    124

    Resolved [RESOLVED] I'm Looking For A List Of Most Efficient Algorithms

    I never thought I would need one because I could usually find out with an Internet search, but VB .NET is starting to show up more and more in the searches, and VB6 less and less.

    Does anyone have, or know where I can find, a list of what algorithms to use in what situations?

    A not very good example is using Longs instead of Integers. From a memory standpoint, Integers seem to make sense, but I've been told that Longs process faster.

    What I'm working on is converting some of the tables in 'Machinery's Handbook' to VB 6 applications. They aren't very complicated, so I thought I might try and make the code as efficient as possible.
    AMD FX-4300, WinXPSP3, VB6SP6

  2. #2
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,253

    Re: I'm Looking For A List Of Most Efficient Algorithms

    Did you ever tried the '-' Operator in Google?

    Your problem-description is too common - please point out a specific algorithm -
    and you will get help (or at least a matching google-search-string )

    Olaf

  3. #3
    PowerPoster
    Join Date
    Aug 2010
    Location
    Canada
    Posts
    2,451

    Re: I'm Looking For A List Of Most Efficient Algorithms

    It sounds like you might mean best coding practices for efficiency instead of algorithms? If so this might be some interesting reading: http://www.aivosto.com/resources.html

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: I'm Looking For A List Of Most Efficient Algorithms

    Quote Originally Posted by jpbro View Post
    It sounds like you might mean best coding practices for efficiency instead of algorithms?
    I agree. The question is clearly asking about implementation decisions rather than algorithms.

    E.g. you might find the fastest sorting algorithm known to man (for your specific situation, since "fastest" like "best" is a very situational thing). But a poor implementation might make it slower than the worst known algorithm well implemented.

    People need to learn what words mean before trying to use them. With the Internet there is hardly any excuse anymore.

  5. #5
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: I'm Looking For A List Of Most Efficient Algorithms

    Does this link give you any info that might help?

    http://msdn.microsoft.com/en-us/libr...(v=vs.60).aspx

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2013
    Posts
    124

    Re: I'm Looking For A List Of Most Efficient Algorithms

    Quote Originally Posted by dilettante View Post
    I agree. The question is clearly asking about implementation decisions rather than algorithms.

    E.g. you might find the fastest sorting algorithm known to man (for your specific situation, since "fastest" like "best" is a very situational thing). But a poor implementation might make it slower than the worst known algorithm well implemented.

    People need to learn what words mean before trying to use them. With the Internet there is hardly any excuse anymore.
    dilettante, I don't know why you get such a kick out of irritating me.

    Definition of algoritm: problem-solving computer program: a logical sequence of steps for solving a problem, often written out as a flow chart, that can be translated into a computer program.

    That is exactly what I am looking for.

    EDIT: The MSDN link is old news. The Aviosto link has a few interesting articles, but it's not what I'm looking for.

    I'm also not looking for help with only one algorithm.

    There used to be a website that was called ExtremeVB, I think, and it had a whole indexed section on algorithm optimization. If it is even the same site, it is all VB .NET now.

    As I said, the example I gave was very bad. How about this? Things like when to use bit manipulation instead of VB's built in math functions.
    Last edited by Honduras 2811; Apr 6th, 2014 at 05:09 PM. Reason: Saving space.
    AMD FX-4300, WinXPSP3, VB6SP6

  7. #7
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,253

    Re: I'm Looking For A List Of Most Efficient Algorithms

    Quote Originally Posted by Honduras 2811 View Post
    Definition of algoritm: problem-solving computer program: a logical sequence of steps for solving a problem, often written out as a flow chart, that can be translated into a computer program.

    That is exactly what I am looking for.
    No, I don't think so... because you write further below:

    Quote Originally Posted by Honduras 2811 View Post
    There used to be a website that was called ExtremeVB, I think, and it had a whole indexed section on algorithm optimization. If it is even the same site, it is all VB .NET now.
    ... Things like when to use bit manipulation instead of VB's built in math functions.
    So, that sounds more like you're looking for general-code-optimizations
    (what to do, or what to avoid across a whole range of algorithms, meaning
    performance-related implementation-tricks, which are useful to know in VB6).

    And from the top of my head, there's really only a few things, which can be sumed up this way:
    - VB6 has a built-in C-Compiler, which generates native code, that runs about factor 5-10 faster than IDE-PCode
    - The native compiler will find around factor 2-3 in addition, when *all* extended "native options" are checked.
    - For the native compiler to give the above speed increase, you will have to work directly on "native types"
    - the above meaning: VBs standard-types (or UDTs which consist of only those simple types) and arrays of those types
    - avoid Objects and their method-calls in high-frequent inner-loops (same goes for normal function-calls in heavy loops)
    - to handle longer String-content, avoid working directly on the String-Type (with Left$ or Mid$),
    . (use ByteArrays, or even better: SafeArray-mapped 16bit-Int-Arrays in heavy parsing-loops
    - in math-routines the VB-Double (on modern CPUs) is the faster type (compared with a Single)
    - well, Integer-math is still fast - but floating-point-math is not much slower these days
    - use LUT-Arrays (Look-Up-Tables) - to cache (repeatedly occuring) values (pre-calculated) and access them with an "index as parameter"
    - avoid an active Errorhandler in fast routines
    - at least switch it off with On Error Goto 0, when you reach the fast inner loop in a function (assuming the inner-loop was well-tested before).

    That's it already - many of the often occuring BitShifting-stuff in some Base-Algos can be done
    either per simple addition (left shift by one bit using IntValue+IntValue) or by * or \ ... but alternatively also using LUTs.

    The concrete appliance of the above, then depending on the type of algorithm of course.

    Only thing left to say is, that all those tips only play a role in high-frequented loops (with loop-counts
    in the tens of thousands or higher) - it doesn't matter at all, if you used a Variant-Type - or normal
    VB-String-functions - or even the often frowned upon Split("1,2,3",",")(0) sequences, as long as you
    use them only in normal Click- or GUI-Events which come along only "any few seconds" due to
    occasional UserInteraction - a better look can be taken again, when you have constantly running Timers
    (with short intervals below 100) ... but in my experience there's really only a few "hot-spots", where
    extensive optimizations will make sense - but those spots exist of course - they are usually relatively
    easy to identify (e.g. when you time larger blocks - and stuff gets commented out and later back-in) ...
    as said, this will be mostly routines, where some higher loop-counts were applied.

    HTH

    Olaf
    Last edited by Schmidt; Apr 7th, 2014 at 04:51 AM.

  8. #8
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,901

    Re: I'm Looking For A List Of Most Efficient Algorithms

    There used to be a website that was called ExtremeVB, I think, and it had a whole indexed section on algorithm optimization. If it is even the same site, it is all VB .NET now
    Do you mean vbSpeed:
    http://www.xbeat.net/vbspeed/

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Oct 2013
    Posts
    124

    Re: I'm Looking For A List Of Most Efficient Algorithms

    Quote Originally Posted by Arnoutdv View Post
    Do you mean vbSpeed:
    http://www.xbeat.net/vbspeed/
    Purrrfect. That's the one. TYVM.
    AMD FX-4300, WinXPSP3, VB6SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width