c# - Calculate best collection to use in method -
i have search method in custom a* algorithm. uses collection keep track of search doing. set path know doing following collection: contains 860x (lookup) remove 91x add 270x
the order or sorting not matter unless can find way order it. possible generate unique id each node based on x , y value. making dictionary lookup possible.
is there way calculate based on method, best collection use in specific case?
thanks in advance, smiley
the general census says:
- if don't run performance issues, leave alone.
- if , can away it, leave alone.
- if do, can't (or love code tight), benchmark it, , you'll find.
(clarification: didn't use "premature optimization root of evil" reference, because think there place optimization. here's good article subject).
from you're saying, doubt it'll make change, unless you're running on device next no resources, again, unless need it, above numbers, doubt you'll see difference.
edit:
per chat room continuation, suggest looking hashtable , dictionary. more specific, sorted dictionary :) .
interesting read hashtable vs dictionaries in c#, can @ this question , at one.
good luck, , feel free post results others learn.
Comments
Post a Comment