简体   繁体   English

如果我在标记上使用大量的<%@ Register指令,是否会有性能开销?

[英]Is there any performance overhead if I use a lot of <%@ Register directives on markup?

Some of my pages have a lot of <%@ Register directives for controls that are no longer used neither on markup nor dynamically created. 我的某些页面上有很多<%@ Register指令,这些指令不再用于标记或动态创建的控件。

I'm wondering if I would benefit or gain some performance if I bother on removing all those directives from all pages. 我想知道如果我从所有页面中删除所有这些指令是否会受益或获得一些性能。 Thanks for the answers. 感谢您的回答。

There will be some overhead from parsing the directives (especially on first load as the temporary classes are generated), though as you do not use the controls this would be minor. 解析指令会产生一些开销(尤其是在生成临时类时首次加载时),尽管由于您不使用控件,所以这是次要的。

This is something you can test for yourself. 您可以自己测试一下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM