十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
本篇内容介绍了“怎么使用ABAP异步RFC调用提升应用性能”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
成都创新互联公司长期为成百上千客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为双鸭山企业提供专业的网站建设、成都做网站,双鸭山网站改版等技术服务。拥有10年丰富建站经验和众多成功案例,为您定制开发。采用如下report 研究asynchronous RFC call的性能提升:
PARAMETERS: num TYPE i OBLIGATORY DEFAULT 10. DATA:ls_line TYPE zjerry1, lv_start TYPE i, lv_end TYPE i, lv_taskid TYPE c LENGTH 8, lv_index TYPE c LENGTH 4, lv_finished TYPE i, lv_count TYPE i. START-OF-SELECTION. PERFORM solution2. FORM solution2. DELETE FROM zjerry1. GET RUN TIME FIELD lv_start. DO num TIMES. lv_index = sy-index. lv_taskid = 'Task' && lv_index. CALL FUNCTION 'ZINSERT' STARTING NEW TASK lv_taskid PERFORMING callback ON END OF TASK EXPORTING iv_index = CONV comm_product-product_id( sy-index ). ENDDO. WAIT UNTIL lv_finished = num. GET RUN TIME FIELD lv_end. lv_end = lv_end - lv_start. WRITE: / 'Solution2: ' , lv_end COLOR COL_NEGATIVE. SELECT COUNT( * ) INTO lv_count FROM zjerry1. ASSERT lv_count = num. ENDFORM. FORM callback USING p_task TYPE clike. ADD 1 TO lv_finished. ENDFORM. function module ZINSERTmonitor的是一个比较费时的操作,在末尾会有一个DB的insertion: DATA: ls_line TYPE zjerry1, lv_cal TYPE timestamp, lv_cal1 TYPE timestamp. GET TIME STAMP FIELD lv_cal. DO 10000 TIMES. lv_cal = lv_cal + 1. lv_cal = ( lv_cal * 13 ) / 12. DO 100 TIMES. GET TIME STAMP FIELD lv_cal1. lv_cal = lv_cal * 13 / 17. ENDDO. ENDDO. ls_line-code_value = iv_index. INSERT zjerry1 FROM ls_line. ASSERT sy-subrc = 0. COMMIT WORK AND WAIT.
DB的结构非常简单:
如果在report 里直接调用ZINSERT, response time为4.493 seconds.
如果在DO 2 TIMES里调用两次ZINSERT, 两次function module call是依次执行的,response time为8.493 seconds
如果用report 以参数2 以异步的方式调用ZINSERT 2次,report 本身的response time为3.074 seconds:
number = 3:
number = 5:
“怎么使用ABAP异步RFC调用提升应用性能”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注创新互联-成都网站建设公司网站,小编将为大家输出更多高质量的实用文章!