Results 1 to 5 of 5
  1. #1
    stsivaraj is offline Member
    Join Date
    Nov 2010
    Posts
    22
    Rep Power
    0

    Default JavaFx TableView - ScrollTo and scrollToOffSet is taking long time

    Hi Team, <br/>
    I am loading 3L records in table using JavaFx TableView concept. I could figure out some performance issue when apply the scrollTo().
    Initially I tried VirtualFlow -> scrollToOffset() and taking more time. Then I tried VirtualFlow -> scrollTo(). This is comparitively giving better
    performance. But, even scrollTo() is taking 10 seconds to load the page.

    I red in forum, scrollTo() is taking less time than scrollToOffset() but not exact position. This is fine.

    My requirement is, need to focus last scroll position(swith from one page to another page). Please give me a hint to resolve this issue.
    I need to achieve the scroll position as well as better performance.

    Software Details:

    JRE Version - 1.8
    JavaFx Jar - jfxrt.jar (Taking from JRE Version 1.8)



    My Code...

    TableView<TYPE> m_tableView = new TableView<TYPE>();
    m_tableView.getStyleClass().add("DataGrid-Table");
    m_tableView.layout(); // Always taking 15 seconds
    TableViewSkin<?> tableskin = (TableViewSkin<?>) m_tableView.getSkin();
    VirtualFlow virtualFlow = (VirtualFlow) tableskin.getChildren().get(1);
    //virtualFlow.scrollToOffset(50000); // Taking 50 seconds to load the page
    virtualFlow.scrollTo(50000); // Taking 10 seconds to load the page

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: JavaFx TableView - ScrollTo and scrollToOffSet is taking long time

    These are com.sun classes (TableViewSkin and VirtualFlow).
    It's really not recommended to actually use those directly.

    First off, why are you trying to scroll to a particular position like this?
    Second, why are you loading 300,000 (that is correct isn't it?) records into a single GUI table?
    That's what pagination is for.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: JavaFx TableView - ScrollTo and scrollToOffSet is taking long time

    Please do not ask for code as refusal often offends.

    ** This space for rent **

  4. #4
    stsivaraj is offline Member
    Join Date
    Nov 2010
    Posts
    22
    Rep Power
    0

    Default Re: JavaFx TableView - ScrollTo and scrollToOffSet is taking long time

    Quote Originally Posted by Tolls View Post
    These are com.sun classes (TableViewSkin and VirtualFlow).
    It's really not recommended to actually use those directly.

    First off, why are you trying to scroll to a particular position like this?
    Second, why are you loading 300,000 (that is correct isn't it?) records into a single GUI table?
    That's what pagination is for.
    Thanks for your quick response. I can't apply the pagination because customer will not accept. But, customer wants scroll to history functionality. Is there any way to achieve the scroll by com.sun classes or any native way to achieve scrollTo. But, current code is working but taking long time... I checked in forum, they used ScrollPane --- moveH() and moveV(). Is there way to move the scroll to particular range?

    Important : I noticed m_tableView.layout(); is taking 40% time in the log. Is there anything workaround to resolve?
    Last edited by stsivaraj; 09-21-2016 at 09:20 AM.

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: JavaFx TableView - ScrollTo and scrollToOffSet is taking long time

    Here's something I dug up on TableView sorting performance which might be relevant:

    bernhard lutzmann's blog: JavaFX TableView Performance: asObject()

    "
    ... on my laptop sorting a table with 50'000 rows takes a few seconds for the non-optimized columns. The columns using the pre-allocated asObject() sort in less then 50 milliseconds.
    "

    Obviously if you're not using asObject() then this may not apply.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. Replies: 1
    Last Post: 03-17-2016, 05:08 PM
  2. standalone taking so much time than web application
    By akiravelmont in forum Advanced Java
    Replies: 4
    Last Post: 11-01-2014, 06:24 PM
  3. Query taking lot of time to execute..
    By asgardar in forum Advanced Java
    Replies: 4
    Last Post: 01-19-2011, 07:09 PM
  4. MySQl query taking too much time
    By jessie in forum JDBC
    Replies: 16
    Last Post: 11-11-2010, 01:09 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •