开发者

Performance cost when using RouteData.Values instead of querystring collection

Would there be any noticeable performance cost when doing this:

HttpContext.Current.Request.RequestConte开发者_JAVA百科xt.RouteData.Values("key")

as opposed to this:

context.Request("key")


Either way, you're just accessing a collection. The RouteData.Values dictionary will be populated whether you use it or not, as will the Request.QueryString collection. There may be some overhead using Request("key") vs Request.QueryString("key"), as the former has to check the form collection as well, but it would beyond trivial, and I think the query string is checked first anyway.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜