Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Mass 'Set Handler' statements cause performance issue

Former Member
0 Likes
779

Hi,

In constructor method, it directly calls 'SET HANDLER' to register event handler. If I instantiate more than 30, 000 objects associated with this class type, it should take too much time to create objects

For example:

Class A:

Method constructor:

SET HANDLER ****.

ENDMETHOD.

DO 30000 TIMES.

     CREATE OBJECT ref.

ENDDO.

As I know, even registration action could trigger to insert handler into handler table. Why does it consume much time here to create objects?

Thanks a lot

Boer

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
734

Did you try to manage the memory consumed during the creation ot those numerous objects. Also is it a Z-class or a standard one, if it is a Z-class, could you extract the set handler from instance constructor and use a SET HANDLER FOR ALL INSTANCES, in class-constructor maybe, and manage the sender parameter in the handling methods ?

Regards,

Raymond

6 REPLIES 6
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
734

Hello Boer,

What is your rationale for this design? What business requirement you want to achieve?

Imho creating 30k objects is definitely time consuming, i am not surprised at this Btw why are you creating 30k objects - is this really a business requirement?

BR,

Suhas

Read only

Former Member
0 Likes
734

Hello Boer,

Why do you want to create the same Object for 30k times can you plz explain.

Regards

Madhukiran.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
734

Hello Madhukiran,

The "same object" is not created 30k times, 30k objects of the same type( or class, if you may) are created.

BR,

Suhas

Read only

RaymondGiuseppi
Active Contributor
0 Likes
735

Did you try to manage the memory consumed during the creation ot those numerous objects. Also is it a Z-class or a standard one, if it is a Z-class, could you extract the set handler from instance constructor and use a SET HANDLER FOR ALL INSTANCES, in class-constructor maybe, and manage the sender parameter in the handling methods ?

Regards,

Raymond

Read only

0 Likes
734

Appreciate all of you, it's should be a defect from design.

Thanks again.

Boer

Read only

0 Likes
734

Appreciate all of you, it's should be a defect from design.

Thanks again.

Boer