Performance of Resources vs HashTable or ...?
-
At the site Casa.Sapo.pt we use Resource files to store texts for internationalization (one with the portuguese texts and another with the english texts) and we are considering using a HashTable, a Dictionary or a class directly containing strings. In the first performance tests, i simply accessed the text's references into a String reference. The results were these: - Resources: 1238 ms - HashTable: 1910 ms - Dictionary: 1968 ms - Class of Strings: 12 ms As expected, all took 100+ times more time to access the strings than the class with the Strings. But in here came the first strange result. The HashTable performed better than the Dictionary, which i find extremely strange. Then, i tested loading user controls which access strings (a combination of inline accesses "<%%>", using ASP:Literal.Text and others). Now came the really strange results: - Resources: 150 ms - HashTable: 146 ms - Dictionary: 256 ms - Class of Strings: 227 ms Everything is completely «wrong»... User controls accessing the class of String (by a long far the fastest) now is one of the slowest??? The HashTable performs better than all the rest??? The Dictionary, that should be faster than the HashTable, is the exact oposite, it is the slowest!? Can anyone try to explain these strange results? I can't seem to make any conclusion out of these results because i don't understand what is happening to give such strange results and i am left clueless as to if i can really substitute the usage of Resource files to handle internationalization.
Windows is just as secure as Linux (when shielded with a Firewall, Anti-Virus, Anti-Spyware and disconnected from the Internet). Windows has even better performance than Linux (when running without Firewall, Anti-Virus and Anti-Spywayre).