473,421 Members | 1,685 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

Object reference terribly slow with certain user profiles

Hi, group!

Here is some interesting problem:

Our company has developed a large VB6 application that runs very smoothly on
most environments.

However, all of a sudden one of our customers (unsing WinNT SP6) experienced
a dramatic
performance drop. We investigated, and it turned out that it depends on the
user that logs on.
Only certain users with user profiles have those performance troubles with
our software.
After further investigation it turned out that referencing propertys and
methods
of class instances through unspecific object variables (declared "as
Object")
ist over 100 times slower than normal.
For example, this works fine:

Dim o as MyInterestingClass
Dim i%
Set o = MyInterestingClassInstance

for i%=1 to 100
o.DoSomething()
next
This, however, is more than 100 times slower:

Dim o as Object
Dim i%
Set o = MyInterestingClassInstance

for i%=1 to 100
o.DoSomething()
next
Okay, we all know that using unspecific object variables can slow things
down, but not 100 times!
And, as I said, the stunning thing is that only certain users with user
profiles have the problem.

Has anyone heard of such a problem or knows the possible cause of that? How
can user profiles
affect VB6 .EXE files in that way? BTW: We tried to compile to native code
instead of P-Code -
it made no difference at all!

---

Helmut Hoerner
he*******************@hhsoft.com
(pls. leave out the nospam part if you want to send me an email)
Jul 17 '05 #1
3 3879
"Asperamanca" <as*********@yahoo.com> schrieb im Newsbeitrag
news:3b**************************@posting.google.c om...
Some rather obvious suggestions:
Do you use the newest VB6 service pack (SP 5)?
Try to turn off code optimization if you use it, in my experience it
makes more trouble than it's worth.
Have you ananlyzed the differences between there users?
*) Different rights? Does the application have to check the user's
access rights somehow?
*) Different network access settings? If the application accesses a
network, this can slow things down
*) Different applications running? Is enough physical memory
available?

Robert


Hi Robert,

thank you for your suggestions.

- With "Compile to P-Code" there are no optimization settings, and as the
problem occures with "P-Code" as well as with "Native Code" I have little
hope in the different optimization settings.
- Actually, for some deployment reasons we still stick to VB6 SP3. Of
course, you are right, we should investigate if SP5 could fix the problem
- As for the network access: The problem has *nothing* to do with file or
network access. It's simply referencing methods and variables through object
variables.
- Physical Memory ist okay, and there seem to be no difference in running
backround tasks for the different users.

Our latest guess is that with the user profiles someting in the "current
user" part of then registry could get messed up (probaply too many
registered ActiveX objects, or something like that).

Regards,

Helmut Hoerner
he*******************@hhsoft.com
(pls. leave out the nospam part if you want to send me an email)
Jul 17 '05 #2
As I see it, the only difference is early time binding vs late time
binding. The only additional chore for late time binding is finding
the actual address of the function you want to call from a table. I'm
not entirely sure, but I think in VB6 classes are just COM objects,
internally, so this task would be up to the OS (please correct me
someone, if I'm wrong).

Therefore, my best guess is that NT 4.0 is a bit screwed up (which is
a safe guess anyway, from my experience). Of course, that wouldn't be
a lot of help.

My best suggestion is trying to avoid the generic Object. That can be
though, and sometime outright impossible, I know. Maybe try if using
an Interface helps - an Interface where DoSomething is defined, which
is implemented by the
MyInterestingClass. Then, you wouldn't have to declare the variable as
Object, but rather as MyInterface, and late time binding should not be
necessary for DoSomething.

Hope that helps

Robert
Jul 17 '05 #3

"Asperamanca" <as*********@yahoo.com> wrote in
news:3b**************************@posting.google.c om...
As I see it, the only difference is early time binding vs late time
binding. The only additional chore for late time binding is finding
the actual address of the function you want to call from a table. I'm
not entirely sure, but I think in VB6 classes are just COM objects,
internally, so this task would be up to the OS (please correct me
someone, if I'm wrong).
I don't know about that for sure, but the problems we have seem to suggest
that you are right. Obviously the the task *is* up to the OS, or how else
could the performance suddenly get worse?
Therefore, my best guess is that NT 4.0 is a bit screwed up (which is
a safe guess anyway, from my experience). Of course, that wouldn't be
a lot of help.
Yep.
My best suggestion is trying to avoid the generic Object. That can be
though, and sometime outright impossible, I know. Maybe try if using
an Interface helps - an Interface where DoSomething is defined, which
is implemented by the
MyInterestingClass. Then, you wouldn't have to declare the variable as
Object, but rather as MyInterface, and late time binding should not be
necessary for DoSomething.


Actually, today we have tried just that - and you know what: It helps!!!

Still, it's very annoying and a lot of work, but at least we have a
workaround now! Thank you very much for your time and your suggestions!

---

Helmut Hoerner
he*******************@hhsoft.com
(pls. leave out the nospam part if you want to send me an email)

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

38
by: VK | last post by:
Hello, In my object I have getDirectory() method which returns 2-dimentional array (or an imitation of 2-dimentional array using two JavaScript objects with auto-handled length property - please...
9
by: Moe Sizlak | last post by:
Hi There, I am trying to write the selected value of a listcontrol when a button is clicked and I keep getting the error "object not set to a reference of an object". The libox itself is in a...
12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
50
by: diffuser78 | last post by:
I have just started to learn python. Some said that its slow. Can somebody pin point the issue. Thans
26
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
12
by: Belebele | last post by:
Suppose that a class A depends on class B because an object of class B is passed into A's constructor. See below: class B { ... }; class A { public: A(B const& b); ... };
2
by: Paul Lemke | last post by:
Hello, I currently have an application that uses authenticates users via NTLM. I would like to provide a user a directory listing of a folder. Everyone has read access to the folder, but the only...
9
by: =?Utf-8?B?Sm9obiBBdXN0aW4=?= | last post by:
I have an app that prints entry tickets. If the printer driver is not set up exactly to detect the black mark on the back of the ticket, the tickets do not print correctly. Because of this, all...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.