天翼云代理,天翼云代理商,北京代理商
天翼云2.5折专线:18510009100/18510009200(全国市话)

ABAP动态编程的性能开销 - Overhead of ABAP dynamic programming

2021-11-25 09:02:39

In Mytask offline performance improvement, it is necessary to support both two DDIC structure modelled in BP and Task, that is, crmt_odata_attachment_t and crmt_bp_odata_attachment_t. It is unknown which data type will be used since they are determined by runtime according to different urls passed from frontend.

The first approach to support both structure is first trying with my task structure using line ASSIGN lr_ref->* TO CASTING. If this line fails, we can know the structure does not belong to Task model, so we can use BP structure to store result.

In this approach, we have defined two variables with separate field symbol with data type crmt_odata_attachment_t and crmt_bp_odata_attachment_t to hold result.

image.png

In approach2, we use generic programming style, neither dedicated type for BP nor for Task is defined in the code. Instead, “ANY TABLE” is defined.

image.png

In ABAP help, it is said we should avoid generic programming unless it is really necessary from security and performance perspective. In this case, I would like to know the performance loss if I use approach2 compared with approach1.

Then I write the following report to get answer:

image.png


When handling with 10 tasks: performance difference: 300 microseconds

image.png


100 tasks: approach1 is one time faster than approach2

image.png


500 tasks:

image.png


1000 tasks:

image.png


10000 tasks:


image.png

12年经验 · 提供上云保障

服务热线:132-6161-6125(手机) 400-150-1900(全国市话)

站内导航: 天翼云服务器价格| 天翼云购买流程| 天翼云代理| 北京天翼云代理商| 杭州天翼云代理| 深圳天翼云代理商| 钉钉代理商| 阿里云代理| 公司官网

我公司收款账号| 天翼云备案系统

CopyRight © 2019 天翼云代理商. All Rights Reserved 京ICP备2024071855号-7 管理-北京优胜智连科技有限公司