0

I was facing performance issues with a simple WinDev application with a couple of nested 'for' loops that iterate about 7 million times.

This simple application took around 30 seconds to finish in WinDev but only about 10 milliseconds in Java or C++ (yes, I am sure it's the same app).

After many tries I just made a simple 'for' loop to iterate 180 million times in both Java and WinDev and I am now concerned about the general performance of WinDev. This is the simple program:

dtStartDate = SysDateTime()
myCount is int = 0
mySize is int = 180000000
FOR i = 1 _TO_ mySize
       myCount++
END
dtFinalDate = SysDateTime()
dDiferenciaCalculada = dtFinalDate - dtStartDate
UpdateDebugOutput("time: " + dDiferenciaCalculada..InMilliseconds + "; myCount: " + myCount)
RETURN

In my computer this 'for' loop takes around 5000 milliseconds to complete in Windev but only 60 milliseconds in Java.

Is there something I'm doing wrong?

Thank you very much.

--- UPDATE 20170524 ---

The real application I was testing is next:

WinDev app: https://www.dropbox.com/s/3vm0yrfcb3wc46r/TestProject.zip?dl=0

Java app: https://www.dropbox.com/s/j896r3pl5kh2iit/playground_java.zip?dl=0

It's a simple app that reads a file, makes some basic calculation and fills some objects of an array with that data. The WindDev app is taking around 27 seconds and the Java app only a few milliseconds and I don't know how to speed up the process in WinDev.

Could you propose some alternatives to my approach?

4

1 回答 1

0

Windev 不是最快的,而且到目前为止。但是您不会因此而选择Windev。在这种情况下,使用并行函数显然可以加快您的程序。

更新 24/05/2017 - 09:24

我的错,Windev 或多或少地遵循 C# 语言的演变,但他们没有实现 C# Parallel.For。如果你真的想加快你的工作并且你只在 Windows 上工作,你可以使用一个 .Net 库来完成你的函数的脏工作并使用Parallel.For你从应用程序调用的。Windev 与 .Net 库配合得非常顺畅。

更新 24/05/2017 - 10:58 当然我没有分享正确的链接:http ://doc.windev.com/en-US/?2012002

于 2017-05-24T05:46:31.673 回答