Skip to content

Commit

Permalink
add performance testcase (#1360)
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp authored Jan 5, 2024
1 parent b706bc2 commit 000f9d5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions performance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {test18} from "./test18";
import {test19} from "./test19";
import {test20} from "./test20";
import {test21} from "./test21";
import {test22} from "./test22";

// NOTE: does not run via Mocha

Expand Down Expand Up @@ -60,6 +61,7 @@ const tests: Tests = [
{name: "19: Call method, compatible structure", abap: test19},
{name: "20: Call method, identical structure", abap: test20},
{name: "21: CASE many char constants", abap: test21},
{name: "22: READ TABLE WITH KEY secondary", abap: test22},
];

async function execute(t: Test) {
Expand Down
31 changes: 31 additions & 0 deletions performance/test22.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
export const test22 = `
TYPES: BEGIN OF ty_data,
name TYPE string,
full_name TYPE string,
END OF ty_data.
TYPES ty_data_tt TYPE STANDARD TABLE OF ty_data WITH DEFAULT KEY
WITH UNIQUE SORTED KEY key_full_name COMPONENTS full_name.
DATA lt_data TYPE ty_data_tt.
DATA ls_data LIKE LINE OF lt_data.
FORM init.
DO 10000 TIMES.
ls_data-name = |a{ sy-index }|.
ls_data-full_name = |b{ sy-index }|.
INSERT ls_data INTO TABLE lt_data.
ENDDO.
ENDFORM.
FORM search.
DO 400 TIMES.
* READ TABLE lt_data INTO ls_data WITH KEY full_name = |b9999|.
READ TABLE lt_data INTO ls_data WITH KEY key_full_name COMPONENTS full_name = 'b9999'.
ASSERT sy-subrc = 0.
ENDDO.
ENDFORM.
START-OF-SELECTION.
PERFORM init.
PERFORM search.`;

0 comments on commit 000f9d5

Please sign in to comment.