matlab分时代码-Vissim.IPC.Proxy:VissimCOM应用程序的零开销进程内COM(IPC)代理增强性能

  • Z4_909130
    了解作者
  • 4.9MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-02 07:52
    上传日期
matlab分时代码vissim-ipcp Vissim进程内COM代理,将Vissim的性能提升高达x15! 关于 Vissim是PTV开发的使用最广泛且行业领先的微观交通模拟器。 它为用户定制的应用程序提供了基于COM的界面,从而将Vissim称为进程外自动化服务器。 Vissim COM既方便又强大,但是它可能会很慢,尤其是对于循环密集型应用程序而言。 尽管该接口经过了精心设计和全面的设计,但仅支持进程外调用站点(其性能受事件限制的基于COM的COM脚本(进程内COM)除外)。 当以逐步的方式调用Vissim COM接口时,运行时性能可能会变得不可接受。 性能下降主要是由于COM从一个程序到另一个程序的封送处理。 当使用.NET语言(如C#)或脚本语言(如Python或Matlab)时,由于.NET COM p / invoke或IDispatch接口的额外运行时开销,性能进一步恶化。 因此,我对Vissim COM模型进行了这种“修改”。 它实现了零开销代理,该代理使Vissim COM成为进程内COM。 换句话说,我们不再需要将Vissim称为进程外自动化服务器。 更好的是,
Vissim_IPC_Proxy-master.zip
内容介绍
# vissim-ipcp Vissim in-process COM proxy, BOOST Vissim performance up to x15 faster! # About Vissim is the most widely-used and industry-leading microscopic traffic simulator developed by PTV. It provides a COM-based interface for user-customized applications, invoking Vissim as an out-of-process automation server. Vissim COM is convenient and powerful, however, it can be slow especially for loop-intensive applications. Albeit the interface is well designed and comprehensive, it ONLY supports out-of-process call site (except its performance-constrained event-based COM scripting, which is in-process COM). When calling Vissim COM interface in a simstep-by-step fashion, the run time performance could possibly become unacceptable. - The performance hit is mainly due to the COM marshaling from one program to the other. The performance hit can be further exacerbated when using .NET languages such as C#, or scripting langue such as Python or Matlab, because of .NET COM p/invoke , or the additional run-time overhead of the IDispatch interface. So I made this "hack" to Vissim COM model. It implements a zero-overhead proxy that enables Vissim COM as in-process COM. In other words, we no longer have to invoke Vissim as an out-of-process automation server. Better, we now have access to all the functionalities (theoretically) in the same process space as the Vissim host. This will greatly improve the run time performance, which in my case, boosting the speed as much as ~x15 faster. Your mileage may vary, though. # Vissim COM can be slow, how do we improve it? This Vissim in-process COM proxy improves Vissim COM performance by making it possible to call Vissim COM interface in the same process space, for example, from inside Driver Model Dll, or from inside Signal Control Dll. Several unconventional yet quite clever "hacking tricks" have been employed (the source code reveals all the details): - The Vissim Launcher will launch Vissim.exe while injecting a Dll, named VissimComHook.dll, as Operating System hook into Vissim process space - The VissimComHook.dll will intercept Vissim's calls to Windows Operating System COM runtime (i.e., Ole.dll). This includes first creating a dummy empty COM script - which will "cheat" Vissim to construct an internal IVissim object when Vissim tries to establish a site for active scripting - As soon as the site of active scripting is obtained ("hijacked") by VissimComHook.dll via hooking ("intercepting") Vissim call to Ole.dll (COM runtime), the site is forwarded to VissimInProcComProxy.dll, and cached there - VissimInProcComProxy.dll itself is an in-process COM server sharing the same memory space with Vissim. It serves as a proxy of Vissim in-process COM, because it internally holds a copy of the aforementioned active scripting site. What it actually does, is quite simple - it just uses the cached active scripting site to do a simple QueryInterface to get the IUnknown interface. The IUnknown interface, points to Vissim's internal implementation object of IVissim - The IVissim obtained this way, is a pure in-process handle to Vissim's internal COM object. Once we hunt it down, we can do the normal things we used to do with the standard Vissim COM interfaces. Imagination will be your limit! # Usage This blog article provides a sample on how to use it with C++. http://blog.wupingxin.net/dissecting-vissim-com-internal-from-inside-out-7-installation-and-a-sample-in-c/ # More readings - http://blog.wupingxin.net/advanced-vissim-com-programming-1-vissims-com-thread-model-and-instance-model/ - http://blog.wupingxin.net/dissecting-vissim-com-internal-1/ - http://blog.wupingxin.net/dissecting-vissim-com-internal-from-inside-out-2/ - http://blog.wupingxin.net/dissecting-vissim-com-internal-from-inside-out-3/ - http://blog.wupingxin.net/dissecting-vissim-com-internal-from-inside-out-4-a-loop-hole-for-a-perfect-solution/ - http://blog.wupingxin.net/dissecting-vissim-com-internal-from-inside-out-5-a-binary-fix-up-for-vissim-in-process-com/ - http://blog.wupingxin.net/dissecting-vissim-com-internal-from-inside-out-6-check-out-the-real-horsepower/ - http://blog.wupingxin.net/dissecting-vissim-com-internal-from-inside-out-7-installation-and-a-sample-in-c/ - http://blog.wupingxin.net/vissim-com-interface-design-a-pitfall-and-a-caveat/
评论
    相关推荐
    • Proxy服务器源代码
      Proxy服务器源代码
    • VB做的Proxy服务器源代码
      VB做的Proxy服务器源代码 借花而已。不用钱的。
    • ex-proxy:节点代理服务器
      ex-proxy:节点代理服务器
    • CC Proxy 7.2
      代理服务器CCProxy于2000年6月问世,是国内最流行的下载量最大的的国产代理服务器软件。主要用于局域网内共享宽带上网,ADSL共享上网、专线代理共享、ISDN代理共享、卫星代理共享、蓝牙代理共享和二级代理等共享代理...
    • Radvision SIP proxy 服务器
      Radvision SIP proxy 服务器,可以用于测试和实用部署.
    • ProxyIP代理服务器
      一款很好用的代理软件。 提供常用常见软件下载,小巧实用的小软件、小工具, 热门必备精品软件等,为尽可能的方便用户使用,软 件多为免费软件或绿色版,并附上原创的软件体验心 得及介绍。
    • 用VB做的Proxy服务器源代码
      用VB做的Proxy服务器源代码
    • Proxy Hunter
      代理服务器猎手,可以很快速的查找网络上的免费 Proxy 哦!主要有以下特点:支持多网址段、多端口自动查询,支持自动验证并给出速度评价,支持后续的再验证,支持用户设置连接超时和验证超时,支持用户设置验证内容,...
    • Proxy Finder
      Proxy Finder是一个非常快的Proxy查找工具,它可以自动从互联网上寻找到可用的代理服务器,号称在2分钟内可以替你找到10000个,试试看吧!
    • ProxyServer:代理服务器
      代理服务器 运行说明: ./ProxyServer(端口号) 当前功能:同时支持多达 2000 个连接。(多线程)Get 方法 未来功能:发布。