xsharp.eu • speed of LOCATE command in X# vs VFP - Page 3
Page 3 of 4

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 3:10 pm
by Chris
Hi Loy,

This extreme difference is because of the caching VFP does in this case. If we adjust the RDD in X# to also keep the data in memory instead of reading it always from disk, of course the speed will be also greatly improved.

But still, indeed there's a relatively large difference also without this caching. Some of that, I am sure it is because X# is managed code, while VFP uses pure Win32 file access etc, also X# works in a unicode environment while VFP doesn't, so some (larger or smaller) speed difference will always exist, it's the price to pay for having otherwise general progress. I mean for example the Windows OS is A LOT slower than what MS DOS was 25 years ago, but that does not mean anybody (well, almost anybody :)) would want to go back to the DOS days...

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 3:37 pm
by leon-ts
Loy,

This XSharp example takes just under 2 minutes on my computer. The same example in VO runs for 4 seconds. This is, of course, a huge difference. I would even say unacceptable.

P.S. If you redirect the file stream into memory in XSharp, then the example takes 8 seconds.

Best regards,
Leonid

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 3:57 pm
by leon-ts
At the moment, I have already managed to transfer a large amount of code from VO to XSharp and there is already one small fully working application that has been sent to production. Therefore, I can already conclude about the performance of XSharp (managed) vs VO (native). There are sections of code that work in a comparable manner, and there are sections that work 30% slower in XSharp compared to VO. But there are even some that now work faster in a new (transported) application. But for this, I made changes to the code, bringing it closer to a more appropriate NET environment. In total, the application works at an acceptable speed, not much worse than in VO. And its separate functionality is even more stable and faster than in VO.

At the same time, my team and I received:
- modern development environment (Visual Studio 2019)
- powerful NET language XSharp
- improved teamwork with projects via git (built into VS)

But, again, the 30x difference between VO and XSharp in this particular example you gave is unacceptable. I think we need to ask the XSharp team to deal with this problem in the XSharp RDD subsystem.

Best regards,
Leonid

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 4:00 pm
by Loy2888
So the case is different in VFP/X#, it looks like VO/X# performs a little bit better.

I tried to redirect the file stream into memory in VFP/X# and the difference is not much (minus 2-3 seconds).

I don't use VO/X# so I can't compare.

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 4:08 pm
by leon-ts
Loy,

I ran your example in XSharp exactly as you did with the VFP dialect enabled. I uncommented the line

Code: Select all

FConvertToMemoryStream(DbInfo(DBI_FILEHANDLE))
and this example in my VFP/X # completed in 8 seconds.

And only later I wondered how it would work in VO and ran this test in VO too.

Best regards,
Leonid

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 4:21 pm
by Loy2888
Hmmm, yours is faster at 8 seconds? Is this the "SKIP" example? or the "LOCATE" example. The 8 seconds for me is the "LOCATE" example.
But on the "SKIP' example, see my attached screenshot here with FConvertToMemoryStream(DbInfo(DBI_FILEHANDLE)) enabled.

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 5:14 pm
by leon-ts
Loy,

With FConvertToMemoryStream(DbInfo(DBI_FILEHANDLE)) enabled my results (your tests) are as follows
LOCATE: 1 sec
SKIP: 8 sec

If FConvertToMemoryStream(DbInfo(DBI_FILEHANDLE)) disabled (commented) my results (your tests) are as follows
LOCATE: 8 sec
SKIP: ~2 min

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 5:49 pm
by Loy2888
I forgot to mention that I have 1000 records in my TEMP.DBF. When I reduced this to 100 records, I have the same result as yours.

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 5:55 pm
by leon-ts
Loy,

My temptab.dbf file has two fields ([SERIES] N,8 and [NAME] C,100) and 1000 records.

speed of LOCATE command in X# vs VFP

Posted: Tue Aug 18, 2020 6:03 pm
by Chris
Guys, as Robert said, this problem is indeed already acknowledged and will be looked at!