FoxPro and .NET Interop
wwDotNetBridge - Serialize over 100k cursor rows to .NET DataSet too slow
Gravatar is a globally recognized avatar based on your email address. wwDotNetBridge - Serialize over 100k cursor rows to .NET DataSet too slow
  Irwin
  All
  Aug 6, 2019 @ 12:19am

How to increase the performance in this case?

Gravatar is a globally recognized avatar based on your email address. re: wwDotNetBridge - Serialize over 100k cursor rows to .NET DataSet too slow
  Rick Strahl
  Irwin
  Aug 6, 2019 @ 07:35am

Large cursor count Serialization is slow and it happens internally in .NET so I don't think anything that wwDotnetBridge does can help in making this faster.

What exactly are you doing for 'serialization' in this case?

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: wwDotNetBridge - Serialize over 100k cursor rows to .NET DataSet too slow
  Irwin
  Rick Strahl
  Aug 7, 2019 @ 12:34am

I'm doing this:

*- Create cursor cTest
*- Insert 100k rows into cTest

loBridge = Createobject("wwDotNetBridge","V4")
loDataSet = loBridge.CursorToDataSet("cTest") && This process takes time

I'm afraid there's nothing wwDotBridge can do because this depends a lot of user's machine resources right?

Gravatar is a globally recognized avatar based on your email address. re: wwDotNetBridge - Serialize over 100k cursor rows to .NET DataSet too slow
  Rick Strahl
  Irwin
  Aug 8, 2019 @ 01:40am

Yes it's slow because that code has to do multiple conversions - first into XML then to the .NET dataset. Large sets will create huge strings and that's what ends up slowing down the process.

All the code for this is internal - XMLAdapter in FoxPro and XML to DataSet serialization in .NET - so there's no place to optimize. There might be other ways to use explicit .NET code that you build yourself but even that requires that the data is passed to .NET in some way and iterated over which also is not cery fast.

So - bottom line: It's not a good idea to serialize huge sets of data this way on a regular basis. It's probably fine for one time updates, it's not a good idea if you need to do this constantly.

+++ Rick ---

© 1996-2024