即使在我的服务类上使用 sgen 仍然会导致构造函数极其缓慢
因此,我正在尝试加快应用程序的启动时间,并且我已经确定了一个需要解决的主要瓶颈。我们的每个 Web 服务客户端类都需要花费很长时间和一天的时间来实例化。一些调查显示这完全是由于 SoapHttpClientProtocol 运行GenerateXMLMappings 造成的。我开始搜索这方面的信息,发现这篇文章 Slow SoapHttpClientProtocol constructor
我已经准备好吹响号角了因为我的问题反映了信中所讨论的内容。我完成了第一篇文章中列出的每个步骤,使用 sgen 预生成序列化器 dll,然后从代码中删除各种标签,并将其构建到一个普通的 dll 中,我在应用程序中将其作为普通引用引用(而不是到网络参考)。然而,毕竟,在分析应用程序时我没有看到任何差异。大量的时间仍然花在作为 SoapHttpClientProtocol 构造函数的一部分的GenerateXMLMappings 上。
我已经验证它实际上正在使用我的自定义 Web 服务客户端 dll。我还验证了它至少在寻找 XmlSerializers dll(如果我不包含该文件,我可以看到 filenotfound 吐出它)。
有谁有关于 SoapHttpClientProtocol 构造函数如何决定它需要做什么的详细信息?这是一个非常令人沮丧的问题,因为整个过程似乎是黑匣子,没有很好的方法来了解内部实际发生的情况。
预先感谢您的任何帮助——我在这方面完全反对。
So I'm trying to speed up our applications startup times -- and I've identified a major bottleneck to work on. Each of our webservice client classes takes forever and a day to instantiate. Some investigation revealed this is entirely due to the SoapHttpClientProtocol running GenerateXMLMappings. I started searching for information on this and found this SO post Slow SoapHttpClientProtocol constructor
I was ready to sound the trumpets since my issues mirrored what was talked about there to the letter. I went through every step listed in the first post to use sgen to pre-generate a serializer dll, and then removed the various tags from the code and built that into a normal dll which I referenced in the applciation as a normal reference (as opposed to a web reference). However after all this, I don't see any difference when profiling the application. Tons of time is still soaked up doing GenerateXMLMappings as part of the SoapHttpClientProtocol constructor.
I have verified that it is in fact using my custom webservice client dll. I have also verified that it is at least looking for the XmlSerializers dll (if I do not include the file I can see a filenotfound is spit up about it).
Does anyone have detailed info about how the SoapHttpClientProtocol constructor decides what it needs to do? This is a really frustrating problem because the whole process seems to be blackboxed with no good way to see what is actually going on internally.
Thanks in advance for any help -- I'm completely against a wall on this one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我经常打这个。我很乐意猜测,但猜测通常是错误的。
为了找出问题的真正原因,我只需在 IDE 下运行应用程序,并在运行缓慢时暂停几次,看看它在做什么。这就是这种技术。
好吧,这是我见过的猜测,但对你来说可能是错误的。
I hit this every so often. I'll be happy to guess, but guesses are usually wrong.
To find what the problem really is I just run the app under the IDE and pause it a few times while it's being slow, to see what it's doing. That's this technique.
OK, here are the guesses, which I've seen but for you are probably wrong.