对于 CPU 密集型进程,VB.NET 是否比 VB6 提供任何性能改进?

发布于 2024-12-29 10:17:14 字数 239 浏览 2 评论 0原文

我正在研究用 VB6 编写的数学模型。该模型消耗的 CPU 时间量正成为我们的一些客户关注的问题,并且有人提出将其移植到 VB.NET 将提高其性能。

该模型正在执行大量单精度算术(大型网格上的有限差分方案),并且每五秒左右就会有一次小突发的数据库访问(还不够重要)。仅涉及偶尔使用 ^ 4 运算符的基本算术函数。

有人认为移植到 VB.NET 可能会改善问题(或不会)吗?有谁知道我可以查看哪些可靠的文章或论文来帮助做出这个决定?

I'm working on a mathematical model written in VB6. The amount of CPU time this model is consuming is becoming a concern to some of our customers and the notion has been floated that porting it to VB.NET will improve its performance.

The model is performing a lot of single-precision arithmetic (a finite-difference scheme over a large grid) with small bursts of database access every five seconds or so (not enough to be important). Only basic arithmetic functions with occasional use of the ^ 4 operator are involved.

Does anyone think porting to VB.NET is likely to improve matters (or not)? Does anyone know any reliable articles or papers I can check over to help with this decision?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

倒带 2025-01-05 10:17:14

我的观点是 VB.Net 到目前为止还不会提高性能。改进是由您制定优化算法的能力带来的。

My opinion is that VB.Net won't improve performance by far. The improvement is given by your ability to make an optimized algorith.

奈何桥上唱咆哮 2025-01-05 10:17:14

也许您可以获得的最佳性能提升是消除数据库访问(即使它看起来不重要,I/O 通常是瓶颈,而不是语言本身)。如果可能的话,预先获取数据并在最后保存,而不是每 5 秒访问一次。

另外,正如其他人指出的那样,如果可能的话,请更改算法,因为将代码移植到 .NET 可能只会给您带来很小的性能优势。

但如果您将其更改为 .NET 4.0,也许您可​​以使用并行扩展,并通过使用多个内核真正获得提升。 http://msdn.microsoft.com/en-us/library/dd460693.aspx ,但这也意味着,改变算法

希望它有帮助。 ;-)

Probably the best performance boost you can get is eliminating the DB access (even if it doesnt look important I/O usually is the bottleneck, not the language itself). If possible get the data upfront and save it at the end instead of accesing every 5 secs.

Also as other pointed out, change the algorithm if possible since porting the code to .NET probably will only get you small performance benefits.

But if you change it to .NET 4.0 maybe you can use the parallel extensions and really get a boost by using multiple cores. http://msdn.microsoft.com/en-us/library/dd460693.aspx , but that also means, changing the algorithm

Hope it helps. ;-)

睫毛上残留的泪 2025-01-05 10:17:14

我认为内存管理的改进提高了 VB.NET 的性能

I think that improvements in memory management improve performance in VB.NET

耶耶耶 2025-01-05 10:17:14

为了给您提供正确的答案,我们应该检查您的代码...

但是理论上VB.NET应该性能更高:

  1. 可以在64位机器上编译(不需要太多努力)
  2. VB6被解释,VB.NET几乎被编译
  3. 您可以使用线程(取决于您的算法)和其他“技巧”,这样您就可以使用更多的 CPU 并行进行计算

最好的尝试:将应用程序中最消耗 CPU 的部分移植到 VB.NET 并进行比较。

To provide you with a correct answer we should check your code...

But certainly VB.NET in theory should be more performant:

  1. possibility to compile on 64 bit machines (without too much effort)
  2. VB6 was interpreted, VB.NET is almost compiled
  3. You can use threads (depends on your algorithm) and other "tricks", so you can use more CPUs to make calculations in parallel

Best thing to try: port the most CPU consuming part of your application to VB.NET and compare.

小帐篷 2025-01-05 10:17:14

同样的算法在 VB6 中执行得更快,因为它是用本机语言编译的。
如果程序具有大量内存分配,则在 64 位环境中运行时,它在 .NET 中的执行速度可能会更快。

The same algorithm will perform faster in VB6, because it is compiled in native language.
If the program has extensive memory allocation, it may perform faster in a .NET when running in a 64 bit environment though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文