[vba-v8iss3-v8 2004] v8i longer than v8

Hi All,

I'm using v8 2004 Ver08.05.02.70 And V8i 08.11.09.459

There is a difference of time's execution of this simple vba:

Sub speed_test2()
Dim Lg1 As LineElement
ActiveSettings.Scale.X = 2
ActiveSettings.Scale.Y = 2
ActiveSettings.Scale.Z = 2
For i = 0 To 100
Set Lg1 = CreateLineElement2(Nothing, Point3dFromXY(i, 0), Point3dFromXY(i, 100))
ActiveModelReference.AddElement Lg1
CadInputQueue.SendCommand ("scale")
CadInputQueue.SendDataPointForLocate Lg1, Point3dZero
CadInputQueue.SendDataPoint Point3dFromXY(i, 0)
CadInputQueue.SendReset
Next i
End Sub

Can you tell me why it's so longer with v8i ? Location ?? sendcommand ?

It's just an simple example, and I know it's not "pure vba" but what I am missing?

Laurent

Parents
  • Hi Laurent,

    what does it mean "so longer"? Is it ten times longer or even a hundred times? There is no guarantee API has the same speed in different versions. Many things has changed from V8 2004 Edition inside MicroStation, which is probably the reson of the different speed.

    Because there is no profiler available in MicroStation VBA, you should add a time counter to your code to check what step takes the most of the time.

    In my opinion your code is not very realistic, to use SendCommand, which simulates a user interaction, in a loop is nothing than should be found in well written code.

    So I think the target is not to discuss why one version is different to another (well, if it's hundreds time slower, of course report is as a bug), but if you will be able to identify what line is slower, to find a way how to optimize the code or to do the same thing in a different faster way.

    With regards,

     Jan

Reply
  • Hi Laurent,

    what does it mean "so longer"? Is it ten times longer or even a hundred times? There is no guarantee API has the same speed in different versions. Many things has changed from V8 2004 Edition inside MicroStation, which is probably the reson of the different speed.

    Because there is no profiler available in MicroStation VBA, you should add a time counter to your code to check what step takes the most of the time.

    In my opinion your code is not very realistic, to use SendCommand, which simulates a user interaction, in a loop is nothing than should be found in well written code.

    So I think the target is not to discuss why one version is different to another (well, if it's hundreds time slower, of course report is as a bug), but if you will be able to identify what line is slower, to find a way how to optimize the code or to do the same thing in a different faster way.

    With regards,

     Jan

Children