<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.0</li>
<li>Operating System version: xxx</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>xxx</li>
<li>xxx</li>
<li>xxx</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">The result I expect is that the attachment obtained by the provider after the hession protocol is case sensitive.</p>
<p dir="auto">** 是否可以将attachment 的HashMap 改成 CaseInsensitiveMap? **</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:<br>
Http11InputBuffer:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8758457/67666880-a7b4a800-f9a7-11e9-9b96-2199ac19bbe2.png"><img src="https://user-images.githubusercontent.com/8758457/67666880-a7b4a800-f9a7-11e9-9b96-2199ac19bbe2.png" alt="image" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/8758457/67667209-48a36300-f9a8-11e9-89c0-737c5098f86b.png"><img src="https://user-images.githubusercontent.com/8758457/67667209-48a36300-f9a8-11e9-89c0-737c5098f86b.png" alt="image" style="max-width: 100%;"></a></p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<p dir="auto">1，创建map或者list时传入原始数据的长度，避免数据量大时进行扩容<br>
例如<br>
<code class="notranslate"> result = new HashMap(size);</code></p>
<p dir="auto">2，避免无意义的方法调用<br>
例如：</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="            Map&lt;Object, Object&gt; map;
            // when return type is not the subclass of return type from the signature and not an interface
            if (!type.isInterface() &amp;&amp; !type.isAssignableFrom(pojo.getClass())) {
                try {
                    map = (Map&lt;Object, Object&gt;) type.newInstance();
                    Map&lt;Object, Object&gt; mapPojo = (Map&lt;Object, Object&gt;) pojo;
                    map.putAll(mapPojo);
                    if (GENERIC_WITH_CLZ) {
                        map.remove(&quot;class&quot;);
                    }
                } catch (Exception e) {
                    //ignore error
                    map = (Map&lt;Object, Object&gt;) pojo;
                }
            } else {
                map = (Map&lt;Object, Object&gt;) pojo;
            }
"><pre class="notranslate"><code class="notranslate">            Map&lt;Object, Object&gt; map;
            // when return type is not the subclass of return type from the signature and not an interface
            if (!type.isInterface() &amp;&amp; !type.isAssignableFrom(pojo.getClass())) {
                try {
                    map = (Map&lt;Object, Object&gt;) type.newInstance();
                    Map&lt;Object, Object&gt; mapPojo = (Map&lt;Object, Object&gt;) pojo;
                    map.putAll(mapPojo);
                    if (GENERIC_WITH_CLZ) {
                        map.remove("class");
                    }
                } catch (Exception e) {
                    //ignore error
                    map = (Map&lt;Object, Object&gt;) pojo;
                }
            } else {
                map = (Map&lt;Object, Object&gt;) pojo;
            }

</code></pre></div>
<p dir="auto">根据逻辑，pojo本身是一个map，又创建了一个新map来存放，无存在意义</p>
<p dir="auto">3，其他一些优化<br>
例如某个pojo的method取到之后，不需要再取filed，没有实际意义。</p>