mirror of
https://github.com/abapGit/abapGit.git
synced 2025-05-01 12:20:51 +08:00
performance optimization parallel mode (#5187)
* performance optimization parallel mode in parallel mode a new session is created for each object to be serialized. method IS_TYPE_SUPPORTED is called in each new session with only one object type. however all objects are loaded via method SUPPORTED_LIST. this change implements a specific cache for method IS_TYPE_SUPPORTED. * Update src/objects/zcl_abapgit_objects.clas.abap Co-authored-by: Christian Günter <christianguenter@googlemail.com> * moved type defintion to PRIVATE SECTION Co-authored-by: Lars Hvam <larshp@hotmail.com> Co-authored-by: Christian Günter <christianguenter@googlemail.com>
This commit is contained in:
parent
b46c8b4599
commit
a637caf864
|
@ -88,6 +88,14 @@ CLASS zcl_abapgit_objects DEFINITION
|
||||||
|
|
||||||
PRIVATE SECTION.
|
PRIVATE SECTION.
|
||||||
|
|
||||||
|
TYPES:
|
||||||
|
BEGIN OF ty_supported_types,
|
||||||
|
obj_type TYPE tadir-object,
|
||||||
|
supported TYPE abap_bool,
|
||||||
|
END OF ty_supported_types.
|
||||||
|
|
||||||
|
TYPES: ty_supported_types_tt TYPE SORTED TABLE OF ty_supported_types WITH UNIQUE KEY obj_type.
|
||||||
|
|
||||||
TYPES:
|
TYPES:
|
||||||
BEGIN OF ty_obj_serializer_item,
|
BEGIN OF ty_obj_serializer_item,
|
||||||
item TYPE zif_abapgit_definitions=>ty_item,
|
item TYPE zif_abapgit_definitions=>ty_item,
|
||||||
|
@ -97,7 +105,8 @@ CLASS zcl_abapgit_objects DEFINITION
|
||||||
ty_obj_serializer_map TYPE SORTED TABLE OF ty_obj_serializer_item WITH UNIQUE KEY item .
|
ty_obj_serializer_map TYPE SORTED TABLE OF ty_obj_serializer_item WITH UNIQUE KEY item .
|
||||||
|
|
||||||
CLASS-DATA gt_obj_serializer_map TYPE ty_obj_serializer_map .
|
CLASS-DATA gt_obj_serializer_map TYPE ty_obj_serializer_map .
|
||||||
CLASS-DATA gt_supported_obj_types TYPE ty_types_tt .
|
CLASS-DATA gt_supported_obj_types TYPE ty_supported_types_tt .
|
||||||
|
CLASS-DATA gv_supported_obj_types_loaded TYPE abap_bool .
|
||||||
|
|
||||||
CLASS-METHODS check_duplicates
|
CLASS-METHODS check_duplicates
|
||||||
IMPORTING
|
IMPORTING
|
||||||
|
@ -172,12 +181,12 @@ CLASS zcl_abapgit_objects DEFINITION
|
||||||
CLASS-METHODS change_package_assignments
|
CLASS-METHODS change_package_assignments
|
||||||
IMPORTING
|
IMPORTING
|
||||||
!is_item TYPE zif_abapgit_definitions=>ty_item
|
!is_item TYPE zif_abapgit_definitions=>ty_item
|
||||||
!ii_log TYPE REF TO zif_abapgit_log.
|
!ii_log TYPE REF TO zif_abapgit_log .
|
||||||
ENDCLASS.
|
ENDCLASS.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLASS zcl_abapgit_objects IMPLEMENTATION.
|
CLASS ZCL_ABAPGIT_OBJECTS IMPLEMENTATION.
|
||||||
|
|
||||||
|
|
||||||
METHOD changed_by.
|
METHOD changed_by.
|
||||||
|
@ -888,13 +897,35 @@ CLASS zcl_abapgit_objects IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD is_type_supported.
|
METHOD is_type_supported.
|
||||||
|
|
||||||
" If necessary, initialize list
|
DATA: ls_item TYPE zif_abapgit_definitions=>ty_item,
|
||||||
IF gt_supported_obj_types IS INITIAL.
|
ls_supported_obj_type TYPE ty_supported_types.
|
||||||
supported_list( ).
|
|
||||||
|
FIELD-SYMBOLS <ls_supported_obj_type> TYPE ty_supported_types.
|
||||||
|
|
||||||
|
IF iv_obj_type IS INITIAL.
|
||||||
|
" empty object type should never exist
|
||||||
|
RETURN.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
READ TABLE gt_supported_obj_types TRANSPORTING NO FIELDS WITH TABLE KEY table_line = iv_obj_type.
|
READ TABLE gt_supported_obj_types
|
||||||
rv_bool = boolc( sy-subrc = 0 ).
|
ASSIGNING <ls_supported_obj_type>
|
||||||
|
WITH KEY obj_type = iv_obj_type.
|
||||||
|
|
||||||
|
IF sy-subrc <> 0.
|
||||||
|
|
||||||
|
ls_item-obj_type = iv_obj_type.
|
||||||
|
|
||||||
|
ls_supported_obj_type-obj_type = iv_obj_type.
|
||||||
|
ls_supported_obj_type-supported = is_supported( ls_item ).
|
||||||
|
|
||||||
|
INSERT ls_supported_obj_type INTO TABLE gt_supported_obj_types.
|
||||||
|
|
||||||
|
rv_bool = ls_supported_obj_type-supported.
|
||||||
|
RETURN.
|
||||||
|
|
||||||
|
ENDIF.
|
||||||
|
|
||||||
|
rv_bool = <ls_supported_obj_type>-supported.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
@ -1020,16 +1051,23 @@ CLASS zcl_abapgit_objects IMPLEMENTATION.
|
||||||
|
|
||||||
METHOD supported_list.
|
METHOD supported_list.
|
||||||
|
|
||||||
DATA: lt_objects TYPE STANDARD TABLE OF ko100,
|
DATA: lt_objects TYPE STANDARD TABLE OF ko100,
|
||||||
ls_item TYPE zif_abapgit_definitions=>ty_item.
|
ls_item TYPE zif_abapgit_definitions=>ty_item,
|
||||||
|
ls_supported_obj_type TYPE ty_supported_types.
|
||||||
|
|
||||||
FIELD-SYMBOLS <ls_object> LIKE LINE OF lt_objects.
|
FIELD-SYMBOLS <ls_object> LIKE LINE OF lt_objects.
|
||||||
|
FIELD-SYMBOLS <ls_supported_obj_type> TYPE ty_supported_types.
|
||||||
|
|
||||||
IF gt_supported_obj_types IS NOT INITIAL.
|
IF gv_supported_obj_types_loaded = abap_true.
|
||||||
rt_types = gt_supported_obj_types.
|
LOOP AT gt_supported_obj_types ASSIGNING <ls_supported_obj_type> WHERE supported = abap_true.
|
||||||
|
INSERT <ls_supported_obj_type>-obj_type INTO TABLE rt_types.
|
||||||
|
ENDLOOP.
|
||||||
RETURN.
|
RETURN.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
|
" delete content because it might be filled already by method IS_TYPE_SUPPORTED
|
||||||
|
CLEAR gt_supported_obj_types.
|
||||||
|
|
||||||
CALL FUNCTION 'TR_OBJECT_TABLE'
|
CALL FUNCTION 'TR_OBJECT_TABLE'
|
||||||
TABLES
|
TABLES
|
||||||
wt_object_text = lt_objects
|
wt_object_text = lt_objects
|
||||||
|
@ -1037,13 +1075,21 @@ CLASS zcl_abapgit_objects IMPLEMENTATION.
|
||||||
OTHERS = 1 ##FM_SUBRC_OK.
|
OTHERS = 1 ##FM_SUBRC_OK.
|
||||||
|
|
||||||
LOOP AT lt_objects ASSIGNING <ls_object> WHERE pgmid = 'R3TR'.
|
LOOP AT lt_objects ASSIGNING <ls_object> WHERE pgmid = 'R3TR'.
|
||||||
|
|
||||||
ls_item-obj_type = <ls_object>-object.
|
ls_item-obj_type = <ls_object>-object.
|
||||||
|
|
||||||
IF is_supported( ls_item ) = abap_true.
|
ls_supported_obj_type-obj_type = <ls_object>-object.
|
||||||
INSERT <ls_object>-object INTO TABLE rt_types.
|
ls_supported_obj_type-supported = is_supported( ls_item ).
|
||||||
|
|
||||||
|
INSERT ls_supported_obj_type INTO TABLE gt_supported_obj_types.
|
||||||
|
|
||||||
|
IF ls_supported_obj_type-supported = abap_true.
|
||||||
|
INSERT ls_supported_obj_type-obj_type INTO TABLE rt_types.
|
||||||
ENDIF.
|
ENDIF.
|
||||||
|
|
||||||
ENDLOOP.
|
ENDLOOP.
|
||||||
gt_supported_obj_types = rt_types.
|
|
||||||
|
gv_supported_obj_types_loaded = abap_true.
|
||||||
|
|
||||||
ENDMETHOD.
|
ENDMETHOD.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user