Performance of String literals vs constants for Session[…] dictionary keys
Session[Constant] vs Session["String Literal"] Performance I'm retrieving user-specific data like ViewData["CartItems"] = Session["CartItems"]; with a string literal for keys on every request. Should I be using constants for this? If yes, how should I go about implementing frequently used string literals and will it significantly affect performance on a high-traffic site? Related question does not address ASP.NET MVC or Session . The reason to use constants has to do with maintainability, not performance. Performance is about the same either way. With a string literal, you can never tell