Perfomance Query

M

^MisterJingo^

I'm working on a project which contains a web interface file browser.
Currently the files can be hidden or shown (based upon file name or
extension type) through a hardcoded series of 'if' and 'switch'
statements.
I'm moving this over to an xml file which will be cached and loaded at
application start and have come up with two possible ways of doing
this:

a) Load the file into a datatable and then for each file object found
in a directory, loop through the datatable to see if that file should
be shown or hidden.

b) create a value object dictionary with the key being the file or
extension name and then a struct, containing things like image (to
attach to file type) and alt/title text (for the image etc), being
stored along with the key. Then simply feeding each name of file
object into the Dictionary and pulling out the corresponding struct
and relevant information.

Which of these would be best performance wise? The first would
generate large amounts of looping, and the second would perhaps have a
performance hit from converting the objects in the dictionary back to
structs.

Or is there a better way of doing this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top