<legend id='2qs7c'><style id='2qs7c'><dir id='2qs7c'><q id='2qs7c'></q></dir></style></legend>

    <small id='2qs7c'></small><noframes id='2qs7c'>

  1. <i id='2qs7c'><tr id='2qs7c'><dt id='2qs7c'><q id='2qs7c'><span id='2qs7c'><b id='2qs7c'><form id='2qs7c'><ins id='2qs7c'></ins><ul id='2qs7c'></ul><sub id='2qs7c'></sub></form><legend id='2qs7c'></legend><bdo id='2qs7c'><pre id='2qs7c'><center id='2qs7c'></center></pre></bdo></b><th id='2qs7c'></th></span></q></dt></tr></i><div id='2qs7c'><tfoot id='2qs7c'></tfoot><dl id='2qs7c'><fieldset id='2qs7c'></fieldset></dl></div>
    1. <tfoot id='2qs7c'></tfoot>
        <bdo id='2qs7c'></bdo><ul id='2qs7c'></ul>
    2. 将 [Serializable] 添加到类是否会对性能产生影响?

      时间:2023-07-27
      • <bdo id='QFNtS'></bdo><ul id='QFNtS'></ul>
        <i id='QFNtS'><tr id='QFNtS'><dt id='QFNtS'><q id='QFNtS'><span id='QFNtS'><b id='QFNtS'><form id='QFNtS'><ins id='QFNtS'></ins><ul id='QFNtS'></ul><sub id='QFNtS'></sub></form><legend id='QFNtS'></legend><bdo id='QFNtS'><pre id='QFNtS'><center id='QFNtS'></center></pre></bdo></b><th id='QFNtS'></th></span></q></dt></tr></i><div id='QFNtS'><tfoot id='QFNtS'></tfoot><dl id='QFNtS'><fieldset id='QFNtS'></fieldset></dl></div>

        <small id='QFNtS'></small><noframes id='QFNtS'>

              <legend id='QFNtS'><style id='QFNtS'><dir id='QFNtS'><q id='QFNtS'></q></dir></style></legend>
                <tbody id='QFNtS'></tbody>

              <tfoot id='QFNtS'></tfoot>

              • 本文介绍了将 [Serializable] 添加到类是否会对性能产生影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我需要将 [Serializable] 属性添加到对性能极为敏感的类.

                I need to add the [Serializable] attribute to a class that is extremely performance sensitive.

                这个属性会对类的操作产生任何性能影响吗?

                Will this attribute have any performance implications on the operation of the class?

                推荐答案

                属性类的实例仅在首次访问时创建.如果您不对特定类进行任何序列化,则永远不会调用 SerializableAttribute() 构造函数,因此不会导致任何性能问题.

                Instances of attribute classes are only created when they're first accessed. If you don't do any serialization on that particular class, the SerializableAttribute() constructor will never be called, hence it won't cause any performance issues.

                这是一篇关于属性构造函数的有趣文章:http://www.codingonthetrain.com/2008/10/attribute-constructors.html

                Here's an interesting article about attribute constructors: http://www.codingonthetrain.com/2008/10/attribute-constructors.html

                这篇关于将 [Serializable] 添加到类是否会对性能产生影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 C# 中组合多个属性 下一篇:如何将 .net 属性应用于返回类型

                相关文章

                <small id='y7pFi'></small><noframes id='y7pFi'>

                <i id='y7pFi'><tr id='y7pFi'><dt id='y7pFi'><q id='y7pFi'><span id='y7pFi'><b id='y7pFi'><form id='y7pFi'><ins id='y7pFi'></ins><ul id='y7pFi'></ul><sub id='y7pFi'></sub></form><legend id='y7pFi'></legend><bdo id='y7pFi'><pre id='y7pFi'><center id='y7pFi'></center></pre></bdo></b><th id='y7pFi'></th></span></q></dt></tr></i><div id='y7pFi'><tfoot id='y7pFi'></tfoot><dl id='y7pFi'><fieldset id='y7pFi'></fieldset></dl></div>

              • <tfoot id='y7pFi'></tfoot>

                    • <bdo id='y7pFi'></bdo><ul id='y7pFi'></ul>
                    <legend id='y7pFi'><style id='y7pFi'><dir id='y7pFi'><q id='y7pFi'></q></dir></style></legend>