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?

rocotocloc
  • 418
  • 6
  • 19

1 Answers1

0

Windev is not the fastest, and by far. But you don't choose Windev because of this. The utilisation of Parallel functions could clearly speed up your program in this case.

Update 24/05/2017 - 09:24

My bad, Windev follows more or less the C# language evolutions but they didn't implement the C# Parallel.For. If you really want to speed up your work and you work on Windows only you can use a .Net library which do the dirty work of your function and use the Parallel.For that you call from your application. Windev works pretty smoothly with .Net Library.

Update 24/05/2017 - 10:58 And of course I haven't share the correct link : http://doc.windev.com/en-US/?2012002

Bidjes
  • 166
  • 4
  • 10
  • Thanks @Bidjes, could you elaborate a little bit your answer? I have also updated my original post with the exact case I am facing to. – rocotocloc May 24 '17 at 07:16
  • I understand I can execute WLanguage code from an external language app (Java for example but the same for your link in C#: http://doc.windev.com/en-US/?7515001&name=external_language_programming_java) but I need the opposite, I have the entire app written in WLanguage and I have to invoke some external Java/C# routine to make the dirty job. How can I invoke this external task from my main WLanguage app (the real scenario is a large WLanguage app, not just the simple project I uploaded) – rocotocloc May 24 '17 at 08:32
  • Ok I'll take a look to that but I am not very experienced in .NET. If I finally had to do something like that I think I'll try to do something with an external Java app. Thank you for your comments. – rocotocloc May 24 '17 at 09:59