Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance problem after updating the version #527

Closed
bilencekic opened this issue Mar 16, 2018 · 11 comments
Closed

Performance problem after updating the version #527

bilencekic opened this issue Mar 16, 2018 · 11 comments

Comments

@bilencekic
Copy link
Contributor

Hi Everyone,
I updated abap2xlsx version via abapgit but now i have a huge performance issue. Nothing changed, i am still using BIND_TABLE method with 16K rows and 60 columns.
Last time it was taking 20-35 seconds with huge file writer but now it is nearly 150 seconds.
I tried SET_TABLE and same issue.
Any advice ?

@ivanfemia
Copy link
Collaborator

ivanfemia commented Mar 16, 2018 via email

@bilencekic
Copy link
Contributor Author

bilencekic commented Mar 16, 2018

xlsx
above is the SAT results, somehow GET_ROW method is taking %91 of total time.
above result is for 10K rows, bind_table is finishing in 23seconds for 16K rows, but excel writer takes so much time. i already have saplink of previois version, worst case i will go back to old version. I am thinking if there is any parameters that i need to set to make it faster.

@ivanfemia
Copy link
Collaborator

Thanks,
I remember a similar issue in the past, I trying to recall what was the final outcome.

@bilencekic
Copy link
Contributor Author

bilencekic commented Mar 16, 2018

thank you :D please try to remember i need to transport requests to test system very soon. now i noticed system is using object_collection_iteration method after version update do get next row. inside iteration method it is using standard table maybe this can cause performance issue i didin't get strange issue.
will it work if i just replace excel writer methods from the old one but keep other classes up to date ?

@bilencekic
Copy link
Contributor Author

bilencekic commented Mar 17, 2018

ok i think i found the issue;
first of all that iterator doesn't look necessary, we can store in a global hash table. Each time itearator is instantiated table keep moving from one variable to another variable.
iterator

and second thing is, program keep doing same search in each line. lets say there is row already in index 10, now it is searching if there is value in index 11, everytime it starts from the beggining.
So in row number 2000, it works 2000 times to check if there is any value. But if there was a global variable like last_value_cell, it can start directly from 2000 to check.
row

alright here is the test results;
same number of rows used with the updated logic, now it is less then 2 sec @ivanfemia

image
here is what i did to GET_ROW method; i changed ADD_ROW method in ROWS class to my hash table rather than iterator and object collection and reading same table in the GET_ROW.

METHOD GET_ROW.

  DATA: LO_ROW_ITERATOR TYPE REF TO CL_OBJECT_COLLECTION_ITERATOR,
        LO_ROW          TYPE REF TO ZCL_EXCEL_ROW.


  IF SY-uname = 'BILEN'.
    READ TABLE ROWS->DT_ROWS ASSIGNING FIELD-SYMBOL(<ls_row>) WITH TABLE KEY ROW_INDEX = IP_ROW.
    IF sy-subrc = 0.
    eo_row = <ls_Row>-ROW.

    ENDIF.
  ELSE.
    LO_ROW_ITERATOR = ME->GET_ROWS_ITERATOR( ).
    WHILE LO_ROW_ITERATOR->HAS_NEXT( ) = ABAP_TRUE.
      LO_ROW ?= LO_ROW_ITERATOR->GET_NEXT( ).
      IF LO_ROW->GET_ROW_INDEX( ) = IP_ROW.
        EO_ROW = LO_ROW.
        EXIT.
      ENDIF.
    ENDWHILE.

  ENDIF.
**  READ TABLE LO_ROW_ITERATOR-> into eo_row INDEX IP_ROW.
  IF EO_ROW IS NOT BOUND.
    EO_ROW = ME->ADD_NEW_ROW( IP_ROW ).
  ENDIF.

ENDMETHOD.

edit : somehow column autosize also not working anymore after update :/

@MLDOliveira
Copy link

Hi @bilencekic I'm haveing the same problemm, all you did was change the method GET_ROW with that code?

@ivanfemia
Copy link
Collaborator

@bilencekic / @MLDOliveira If you can provide a fix to the project it would be really great!

@MLDOliveira
Copy link

@bilencekic Could you commit your correction to the projetc?

@bilencekic
Copy link
Contributor Author

@ivanfemia @MLDOliveira alright i will commit. I changed 2 classes in total, i will commit asap.

@bilencekic
Copy link
Contributor Author

@MLDOliveira have you tested after latest changes ? How is the performance ?

@sandraros
Copy link
Collaborator

Could we close this issue? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants