Fully custom theme vs overriding Modena

2021-03-31 Thread Ed Kennard
Hi all,

I’m about to embark on some work which will remove our dependency on the Modena 
theme.  We currently import Modena then override it wherever necessary, but now 
I want to replace that with our own custom CSS built from the ground up.  The 
new custom CSS will be simpler and flatter than Modena, using a lot less 
insets, borders etc on the controls, and will only target the specific controls 
we need styling for in the app, so the expectation is to have a significantly 
smaller amount of CSS loading into JavaFX than we currently have.

My questions for the list are:

- Given the CSS styling of controls will be simpler than Modena, and there'll 
be a reduced amount of CSS that JavaFX will need to load as well as process 
throughout the app while it's running, I'm expecting to see less CSS churn 
while profiling the app, and perhaps even some visibly noticeable performance 
improvements, too.  Is this a reasonable expectation, or is that unlikely in 
reality?

- To anyone who has experience implementing custom themes, do you have any 
wisdom to impart, or links to any such advice, to help me prepare for this, 
design my CSS in the most JavaFX-optimal way possible, or avoid any common 
mistakes?

Thanks!

Ed




Re: TableView with many columns poor ui performance

2020-02-06 Thread Ed Kennard
Great, thanks Danny, I’ll check it out and let you know how it goes



From: Danny Gonzalez 
Date: Thursday, 6 February 2020 at 17:27
To: Ed Kennard 
Cc: "openjfx-dev@openjdk.java.net" 
Subject: Re: TableView with many columns poor ui performance

Hi Ed,

I have submitted a pull request and the branch is here:
https://github.com/screamingfrog/jfx/tree/listeners_optimisation


Danny




On 6 Feb 2020, at 09:50, Ed Kennard mailto:e...@kennard.net>> 
wrote:

Hi Danny,

This is great news, I've previously written about perf  issues with TableView, 
do you have a branch I could try out which is rebased off current jfx master?



On 06/02/2020, 10:40, "openjfx-dev on behalf of Danny Gonzalez" 
mailto:openjfx-dev-boun...@openjdk.java.net>
 on behalf of 
danny.gonza...@screamingfrog.co.uk<mailto:danny.gonza...@screamingfrog.co.uk>> 
wrote:

   Hi,

   We have been struggling with our migration from Java 8 to Java 11 due to 
various issues we are having with TableView. The main issue is the general UI 
lag and slow TableView scroll performance.

   For context here some links around the issues:

   TableView has a horrific performance with many columns #409
   https://github.com/javafxports/openjdk-jfx/issues/409#event-2206515033

   JDK-8088394 : Huge memory consumption in TableView with too many columns
   https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8088394

   JavaFX TreeTableView slow scroll performance
   https://bugs.openjdk.java.net/browse/JDK-8166956

   TableRowSkinBase fails to correctly virtualise cells in horizontal direction
   https://bugs.openjdk.java.net/browse/JDK-8185887

   OpenJFX mailing list thread: TableView slow vertical scrolling with 300+ 
columns
   https://mail.openjdk.java.net/pipermail/openjfx-dev/2020-January/024780.html


   We have a TableView that is being populated with rows dynamically around the 
rate of 2 rows per second. The issue we are experiencing is the lagginess of 
the UI when these rows are being inserted. TableViews with fewer columns don’t 
seem to exhibit the behaviour quite as badly.

   I can see that there was an optimisation in Java 8 that would alleviate the 
TableView performance issue. If you used a fixed cell size in your TableView, a 
bit of optimisation code in TableRowSkinBase.isColumnPartiallyOrFullyVisible 
would  only render the visible columns. This code, as has been documented in 
the first link above, used to work in Java 8 but not now in Java 11. It also 
has a bug where the visible columns calculation is incorrect and instead 
calculates the visibility on the whole width of the TableView rather than the 
visible columns. I have tried fixing this up, and even with this code fixed, it 
brings in other issues where resizing the TableView results in blank columns.

   I have done some testing and can see that the main issues with the slow down 
is to do with the thousands of listeners that are being removed in TableView 
when you add rows or scroll. It is taking up to 60% of the JavaFX Application 
thread.
   For whatever reason the amount of listeners registering/unregistering has 
jumped significantly between Java 8 and Java 11.

   The following changeset for example (which added an extra listener on the 
Node class) impacted TableView performance significantly:

   commit e21606d3a1b73cd4b44383babc750a4b4721edfd
   Author: Florian Kirmaier 
mailto:f...@sandec.de><mailto:f...@sandec.de>>
   Date:   Tue Jan 22 09:08:36 2019 -0800

   8216377: Fix memoryleak for initial nodes of Window
   8207837: Indeterminate ProgressBar does not animate if content is added 
after scene is set on window



   Add or remove the windowShowingChangedListener when the scene changes



   I can see that the code for removing listeners in ExpressionHelper.Generic 
is extremely sub optimal and uses a linear search through an array to remove 
listeners.

   I have rewritten this class to use a Set instead of an Array and it has 
fixed our major TableView issues where the performance of the UI seriously 
deteriorated to the point of not being usable. The CPU usage of 
com.sun.javafx.binding.ExpressionHelper.removeListener in the JavaFX 
Application Thread has dropped from 60% to less than 1%.

   I believe this fix will alleviate the major issues of TableViews detailed in 
the above links.
   I have run my fix through the unit test suite and believe it is functionally 
equivalent to the original code, just much faster.

   I am happy to submit a pull request. I am new to openJFX contributing so any 
pointers of what I need to do here would be appreciated.

   Thanks

   Danny





Re: TableView with many columns poor ui performance

2020-02-06 Thread Ed Kennard
Hi Danny,

This is great news, I've previously written about perf  issues with TableView, 
do you have a branch I could try out which is rebased off current jfx master?



On 06/02/2020, 10:40, "openjfx-dev on behalf of Danny Gonzalez" 
 wrote:

Hi,

We have been struggling with our migration from Java 8 to Java 11 due to 
various issues we are having with TableView. The main issue is the general UI 
lag and slow TableView scroll performance.

For context here some links around the issues:

TableView has a horrific performance with many columns #409
https://github.com/javafxports/openjdk-jfx/issues/409#event-2206515033

JDK-8088394 : Huge memory consumption in TableView with too many columns
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8088394

JavaFX TreeTableView slow scroll performance
https://bugs.openjdk.java.net/browse/JDK-8166956

TableRowSkinBase fails to correctly virtualise cells in horizontal direction
https://bugs.openjdk.java.net/browse/JDK-8185887

OpenJFX mailing list thread: TableView slow vertical scrolling with 300+ 
columns
https://mail.openjdk.java.net/pipermail/openjfx-dev/2020-January/024780.html


We have a TableView that is being populated with rows dynamically around 
the rate of 2 rows per second. The issue we are experiencing is the lagginess 
of the UI when these rows are being inserted. TableViews with fewer columns 
don’t seem to exhibit the behaviour quite as badly.

I can see that there was an optimisation in Java 8 that would alleviate the 
TableView performance issue. If you used a fixed cell size in your TableView, a 
bit of optimisation code in TableRowSkinBase.isColumnPartiallyOrFullyVisible 
would  only render the visible columns. This code, as has been documented in 
the first link above, used to work in Java 8 but not now in Java 11. It also 
has a bug where the visible columns calculation is incorrect and instead 
calculates the visibility on the whole width of the TableView rather than the 
visible columns. I have tried fixing this up, and even with this code fixed, it 
brings in other issues where resizing the TableView results in blank columns.

I have done some testing and can see that the main issues with the slow 
down is to do with the thousands of listeners that are being removed in 
TableView when you add rows or scroll. It is taking up to 60% of the JavaFX 
Application thread.
For whatever reason the amount of listeners registering/unregistering has 
jumped significantly between Java 8 and Java 11.

The following changeset for example (which added an extra listener on the 
Node class) impacted TableView performance significantly:

commit e21606d3a1b73cd4b44383babc750a4b4721edfd
Author: Florian Kirmaier mailto:f...@sandec.de>>
Date:   Tue Jan 22 09:08:36 2019 -0800

8216377: Fix memoryleak for initial nodes of Window
8207837: Indeterminate ProgressBar does not animate if content is added 
after scene is set on window



Add or remove the windowShowingChangedListener when the scene changes



I can see that the code for removing listeners in ExpressionHelper.Generic 
is extremely sub optimal and uses a linear search through an array to remove 
listeners.

I have rewritten this class to use a Set instead of an Array and it has 
fixed our major TableView issues where the performance of the UI seriously 
deteriorated to the point of not being usable. The CPU usage of 
com.sun.javafx.binding.ExpressionHelper.removeListener in the JavaFX 
Application Thread has dropped from 60% to less than 1%.

I believe this fix will alleviate the major issues of TableViews detailed 
in the above links.
I have run my fix through the unit test suite and believe it is 
functionally equivalent to the original code, just much faster.

I am happy to submit a pull request. I am new to openJFX contributing so 
any pointers of what I need to do here would be appreciated.

Thanks

Danny





Re: Memory leak issues related to 2 PRs in OpenJFX

2020-02-05 Thread Ed Kennard
Hi Kevin,

I found the problem with this, and I've pushed a small commit to my fork which 
I think reproduces the behavior I described [1].  Per comments in the code, to 
run the test you'll need to make the ControlsFX library v11 available to the 
build, sorry I didn't do that myself but I'm not familiar with Gradle and it's 
late in the eve for me now.

We rely on ControlsFX's validation framework in our forms, and it's that which 
seems to be triggering the scene to be updated in a way that throws out the 
timing of the adding/removing of the listeners in Node, at least during 
initialization.  I think after initializing the first time, everything works as 
expected.  Hope that helps - pls let me know what you think.

Regarding our code, I've worked around the issue by adding a flag to pause the 
validation decorations during intialization, so I'm able to move forward now.

Thanks

Ed

[1] 
https://github.com/edkennard/jfx/commit/5c724670cd2ff14ec98d37faf8841e74a7e08039



On 04/02/2020, 19:41, "openjfx-dev on behalf of Kevin Rushforth" 
 
wrote:

The first of these bugs, 8090322, did introduce at least one memory leak 
for which 8216377 was the fix.

I'd prefer to resolve the underlying problem rather than just making 
those listeners weak, so it seems worth spending some more time to try 
to narrow it down.

Regarding the out-of-order events, are you doing all operations 
(including those triggered by binding) on the JavaFX application thread? 
My guess is that this is unlikely to be the problem, since you say that 
it is very reproducible, but I thought I'd ask.

-- Kevin


On 2/4/2020 9:48 AM, Ed Kennard wrote:
> Hi everyone,
>
> I’ve been migrating our codebase to Java 11 LTS and OpenJFX 14.  One of 
our GC-related unit tests is failing now, where one of our custom Tab controls 
is supposed to be GC’d.  The test passes against Java 8.
>
> When our GC-related unit tests fail they output exactly what it is that’s 
blocking GC, and in this case it’s pointing to 
Node.windowShowingChangedListener.  If I disable that listener and recompile 
JavaFX, then the test fails again but this time due to 
Node.sceneWindowChangedListener.  If I disable that then the test passes.  
Also, if I re-enable both of these listeners but wrap them in WeakListeners, 
then the test passes.
>
> I believe the two PRs which introduced these listeners are:
>
> 8090322: Need new tree visible property in Node that consider Scene and 
Stage visibility [1]
> 8216377: Fix memoryleak for initial nodes of Window [2]
>
> If I trace when the windowShowingChangedListener is being added or 
removed for my custom controls, I can see that for one of them (shown as “Grid” 
below) they’re being consistently added/removed out of sequence.  This seems to 
result in an attempt to remove a listener which hasn’t been added yet, then 
later on that missed addition happens, resulting in one listener incorrectly 
leftover at the end:
>
> invalidatedScenes - Adding window.showing listener for MetadataTableView
> invalidatedScenes - Removing window.showing listener for MetadataTableView
> *** THIS IS PREMATURE *** invalidatedScenes - Removing window.showing 
listener for Grid
> invalidatedScenes - Adding window.showing listener for MetadataTableView
> invalidatedScenes - Adding window.showing listener for Grid
> invalidatedScenes - Adding window.showing listener for Grid
> invalidatedScenes - Removing window.showing listener for MetadataTableView
> invalidatedScenes - Removing window.showing listener for Grid
>
> I’ve been trying hard to reproduce the issue in a simple test along the 
same lines as the existing one in systemTests…InitialNodesMemoryLeakTest, but 
so far haven’t managed to.  There’s quite a bit going on in our custom 
controls, with some places where it’s necessary to use Platform.runLater to 
ensure a control has been properly initialized before performing other setup 
operations, maybe it’s because of something like that.
>
> Anyway, my question is, do you think it might be safer to change these 
listeners to be weak, in case others manage to create a similar scenario and 
start leaking nodes like this?  If yes, happy to put a PR together for that.  
Or should I continue my pursuit of the underlying issue which has so far eluded 
me, and which I appreciate may be caused by something being done in the wrong 
order in my own code?
>
> Thanks
>
> Ed
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8090322
> [2] https://bugs.openjdk.java.net/browse/JDK-8216377
>




Memory leak issues related to 2 PRs in OpenJFX

2020-02-04 Thread Ed Kennard
Hi everyone,

I’ve been migrating our codebase to Java 11 LTS and OpenJFX 14.  One of our 
GC-related unit tests is failing now, where one of our custom Tab controls is 
supposed to be GC’d.  The test passes against Java 8.

When our GC-related unit tests fail they output exactly what it is that’s 
blocking GC, and in this case it’s pointing to 
Node.windowShowingChangedListener.  If I disable that listener and recompile 
JavaFX, then the test fails again but this time due to 
Node.sceneWindowChangedListener.  If I disable that then the test passes.  
Also, if I re-enable both of these listeners but wrap them in WeakListeners, 
then the test passes.

I believe the two PRs which introduced these listeners are:

8090322: Need new tree visible property in Node that consider Scene and Stage 
visibility [1]
8216377: Fix memoryleak for initial nodes of Window [2]

If I trace when the windowShowingChangedListener is being added or removed for 
my custom controls, I can see that for one of them (shown as “Grid” below) 
they’re being consistently added/removed out of sequence.  This seems to result 
in an attempt to remove a listener which hasn’t been added yet, then later on 
that missed addition happens, resulting in one listener incorrectly leftover at 
the end:

invalidatedScenes - Adding window.showing listener for MetadataTableView
invalidatedScenes - Removing window.showing listener for MetadataTableView
*** THIS IS PREMATURE *** invalidatedScenes - Removing window.showing listener 
for Grid
invalidatedScenes - Adding window.showing listener for MetadataTableView
invalidatedScenes - Adding window.showing listener for Grid
invalidatedScenes - Adding window.showing listener for Grid
invalidatedScenes - Removing window.showing listener for MetadataTableView
invalidatedScenes - Removing window.showing listener for Grid

I’ve been trying hard to reproduce the issue in a simple test along the same 
lines as the existing one in systemTests…InitialNodesMemoryLeakTest, but so far 
haven’t managed to.  There’s quite a bit going on in our custom controls, with 
some places where it’s necessary to use Platform.runLater to ensure a control 
has been properly initialized before performing other setup operations, maybe 
it’s because of something like that.

Anyway, my question is, do you think it might be safer to change these 
listeners to be weak, in case others manage to create a similar scenario and 
start leaking nodes like this?  If yes, happy to put a PR together for that.  
Or should I continue my pursuit of the underlying issue which has so far eluded 
me, and which I appreciate may be caused by something being done in the wrong 
order in my own code?

Thanks

Ed

[1] https://bugs.openjdk.java.net/browse/JDK-8090322
[2] https://bugs.openjdk.java.net/browse/JDK-8216377



Re: Release roadmap for 2 already-merged TableView PRs

2020-01-28 Thread Ed Kennard
Michael, Kevin,

Great, will try out right away!

Thanks!

Ed



On 28/01/2020, 13:58, "openjfx-dev on behalf of Michael Paus" 
 wrote:

Am 28.01.20 um 12:49 schrieb Ed Kennard:
> It looks like the first opportunity to benefit from both changes is to 
wait for the upcoming Java 14 pre-release Feb 6th - is that on schedule, and 
please could I try that out?  Then am I correct in thinking it will be 
officially published at AdpotOpenJDK on March 17th?

Why don't you try that out right now? The pre-releases for OpenJFX 14 
and 15 are available
here <https://gluonhq.com/products/javafx/> and also via Maven/Gradle.

As this is all JFX you do not even need anything beyond JDK 11 although 
the pre-releases
for that are also available here <http://jdk.java.net/14/> and 
<http://jdk.java.net/15/>.

Michael




Re: TableView slow vertical scrolling with 300+ columns

2020-01-28 Thread Ed Kennard
Hi Clemens,

Thanks very much for your message, it definitely helped me crystalize the root 
of the issue beyond my previous understanding, and also gave me some additional 
options on how to work around it :)

Ed






On 27/01/2020, 15:45, "openjfx-dev on behalf of Clemens Kadura" 
 
wrote:

Hello Ed, hello all,

It is also the first time that I become active in this mailing list, 
although I'm already monitoring this list for half a year to get 
familiar with your conventions.
I am co-founder of a software and consulting company in Germany. We 
develop a system (JACAMAR) that combines a serverless no-sql database 
engine with a customizable user interface for do-it-yourself non-IT 
expert end users. We started with an Eclipse based user interface, 
switched in 2015 to a self developed UI and unfortunately found out only 
very late that JavaFX did just the same with, I guess, a lot more 
resources than we have. So we switched another time to JavaFX and are 
about to launch our next version. By going this way, we have gained a 
lot of insights in the field of user interfaces.

To come to your question:
Yes we also experienced issues of poor performance on scrolling virtual 
tables with a lot of columns.
The reason is in the nature of the VirtualFlow, which is the base of 
TableView: It has a "virtual" direction and a "static" direction. By 
default the vertical direction is the virtual one. That means the 
vertical scrollbar works with a value p between 0 and 1. Depending on 
how quick you scroll, only those lines are calculated and rendered, 
which will become visible in the the viewport for a given p. This gives 
good performance for tables with huge amount of lines.
The problem is now the horizontal direction. Since this dimension is 
static, TableRowSkin calculates and renders all TableCells of each 
TableRow independent of its actual visibility in the view port. (see 
TableRowSkinBase line 519ff.)
This works well for TableRows with relatively low number of columns. And 
knowing that, it is obvious, why the horizontal scrolling works so quick 
in your application, because all cells are already prepared and just 
need to be moved in X to become visible.
There are 2 opportunities how to attack that issue:
1.) If you don't have many lines, you could just change the vertical 
property to false (see VirtualFlow line 745). We did it only in a test 
case so far, so we don't have a lot of experience about that.
2.) is a tradeoff between vertical and horizontal performance. A code 
change would be required in TableRowSkinBase to restrict the actual 
creation of TableCells for one line to only those cells that will become 
visible for a particular scroll pulse. That way only 10-20 cells are 
affected for each line and not 300 any longer. If you now scroll 
horizontally, all new cells that become visible, must be additionally 
calculated and rendered at that point in time. Unless you have a 50-inch 
screen, there shouldn't be so many cells, so the loss of performance in 
horizontal direction should be manageable.

At the moment I am still very occupied with our system launch, but I 
intend to participate soon in the community and give back a little bit 
of what we received from using JavaFX for free in our applications up to 
now.

Greetings
Clemens


Am 25.01.2020 um 02:39 schrieb Ed Kennard:
> Hi everyone,
>
> I’m new to the list, so by way of a short introduction, I’ve been working 
with JavaFX for the last 4 years developing a commodities trading risk 
management system from the ground up for a software company I co-founded in 
London.  All our code is written in Scala, the functional style of which is 
essential for the mathematical heavy lifting needed on the backend, but which 
also lends itself really well to UI programming and working with JavaFX.  I’m 
enthusiastic about JavaFX and would love to make a contribution to the project.
>
> At the center of our product is an extension of the TableView control 
that’s responsible for displaying all the output from our pivot reporting 
engine.  Depending on how the user configures the layout of their pivot 
reports, sometimes there are a legitimately large number of columns (300+).  
When that happens, while the horizontal scrolling remains perfectly smooth, the 
vertical scrolling degrades to a somewhat juddery state and CPU usage spikes.
>
> I found an issue raised about this in 2019 on the old JFX GitHub repo 
here…
> https://github.com/javafxports/openjdk-jfx/issues/409
>
> …but I’m not sure whether, per Kevin’s suggestion at the bottom, it was 
ever submitted through the correct channels.  I can confirm that the test code 
inclu

Release roadmap for 2 already-merged TableView PRs

2020-01-28 Thread Ed Kennard
Hi everyone,

In Java 9 there were some issues introduced into the TableView code which 
significantly reduced the extensibility of the skinning.  These issues were 
blocking ones for us, in terms of migrating from 8 to 11, since we rely heavily 
on what was originally exposed, a good example being the 
resizeColumnToFitContent method, originally a protected method in TableViewSkin 
but moved to the static TableSkinUtils.

I’ve found in the more recent history 2 separate commits by Samir Hadzic which 
I believe completely solve this for us:

[1] 8207942: Add new protected VirtualFlow methods for subclassing (exposes 
reorderingProperty, fixed for Java 12)
[2] 8207957: TableSkinUtils should not contain actual code implementation 
(exposes resizeColumnToFitContent again, fixed for Java 14)

This is excellent news, thanks guys!

It looks like the first opportunity to benefit from both changes is to wait for 
the upcoming Java 14 pre-release Feb 6th - is that on schedule, and please 
could I try that out?  Then am I correct in thinking it will be officially 
published at AdpotOpenJDK on March 17th?

Thanks

Ed

[1] https://bugs.openjdk.java.net/browse/JDK-8207942
[2] https://bugs.openjdk.java.net/browse/JDK-8207957




Re: TableView slow vertical scrolling with 300+ columns

2020-01-27 Thread Ed Kennard
Hi Jonathan,

Thanks for jumping into the discussion.

I’ve tested setting a value for fixedCellSize…

Against Java 8, there is indeed a _major_ improvement in vertical scrolling 
performance, but there are some issues that come with that.  Performance of 
horizontal scrolling suffers, becoming similarly juddery to how the vertical 
scrolling was, although not quite as bad.  Also, when scrolling horizontally, 
the left-most 1, 2 or 3 columns are rendered incorrectly, seemingly with their 
values not being set.  This issue gets worse the further you scroll to the 
right, so if the horizontal scroll bar is all the way to the left then there’s 
no issue, but if it’s all the way to the right, in my sample table with 382 
columns, 3.5 columns are rendered blank on the left side of the table.

Against Java 11 LTS, setting fixedCellSize no longer has any positive impact on 
the vertical scrolling, but it does still bring all of the negative effects to 
the horizontal scrolling.

Out of the above, I’m not sure what is valuable to formally submit as 
bugs/changes, versus what not.  If someone could give me guidance on that, 
happy to prepare test code focusing on the useful stuff.

Thanks

Ed



From: Jonathan Giles 
Date: Sunday, 26 January 2020 at 22:48
To: Ed Kennard 
Cc: Nir Lisker , "openjfx-dev@openjdk.java.net" 

Subject: Re: TableView slow vertical scrolling with 300+ columns

It's been a wee while since I built TableView, but from memory there is code in 
there that virtualises the columns, such that those that are scrolled out of 
view are not being included in the scenegraph needlessly. From memory, to 
achieve this all you needed to do was set a fixed row height on the TableView, 
using this API: 
https://docs.oracle.com/javase/8/javafx/api/javafx/scene/control/TableView.html#fixedCellSizeProperty

I'm sure it will won't be a silver bullet, but from my recollection it did 
massively help for these scenarios where there were many columns, most of which 
were not in the viewable area.

-- Jonathan

On Sun, Jan 26, 2020 at 5:11 AM Ed Kennard 
mailto:e...@kennard.net>> wrote:
I did previously look at the ControlsFX SpreadsheetView, but it wasn’t a good 
match, at least at that time.  Off the top of my head, I’m not sure it supports 
nested column headers, which is essential for our purposes. Furthermore, in my 
travels around the internet on this subject I’ve seen comments suggesting it 
has its own performance issues, too.  I will revisit it though, just to be sure.

Beyond that, I haven’t seen any other 3rd party libraries along these lines


From: Nir Lisker mailto:nlis...@gmail.com>>
Date: Saturday, 25 January 2020 at 16:40
To: Ed Kennard mailto:e...@kennard.net>>
Cc: Kevin Rushforth 
mailto:kevin.rushfo...@oracle.com>>, 
"openjfx-dev@openjdk.java.net<mailto:openjfx-dev@openjdk.java.net>" 
mailto:openjfx-dev@openjdk.java.net>>
Subject: Re: TableView slow vertical scrolling with 300+ columns

So might it be better to submit a new feature request to develop a separate and 
leaner control entirely, geared much more towards viewing large datasets 
without all the bells and whistles of a TableView?

 Doesn't ControlsFX have that already, or some other 3rd party library?

On Sat, Jan 25, 2020 at 5:34 PM Ed Kennard 
mailto:e...@kennard.net><mailto:e...@kennard.net<mailto:e...@kennard.net>>>
 wrote:
Hi Kevin, Nir,

I also dug out those two bug reports and agree neither are close enough.  
However, it seems to be general consensus that in order to properly address the 
issue, TableView's virtualisation would need to be changed to support columns 
in addition to rows, and that the extra complexity through the rest of the 
control's features would not be a worthwhile trade-off.

So might it be better to submit a new feature request to develop a separate and 
leaner control entirely, geared much more towards viewing large datasets 
without all the bells and whistles of a TableView?




On 25/01/2020, 15:39, "Kevin Rushforth" 
mailto:kevin.rushfo...@oracle.com><mailto:kevin.rushfo...@oracle.com<mailto:kevin.rushfo...@oracle.com>>>
 wrote:

I took a quick look and didn't see one that was close enough to this, so
I think it's worth submitting a new bug report. The closest I found were
JDK-8166956 [1] and JDK-8185887 [2].

I also would be interested to know whether others have run into this in
their applications.

-- Kevin

[1] https://bugs.openjdk.java.net/browse/JDK-8166956
[2] https://bugs.openjdk.java.net/browse/JDK-8185887


On 1/25/2020 2:10 AM, Nir Lisker wrote:
> Hi Ed,
>
> Try to search JBS [1] for this issue. If you don't find one, you can 
submit
> it through bugs.java.com<http://bugs.java.com><http://bugs.java.com>, 
though I suspect this is known.
>
> I don't know the technicalities of VirtualFlow in Ta

Re: TableView slow vertical scrolling with 300+ columns

2020-01-25 Thread Ed Kennard
I did previously look at the ControlsFX SpreadsheetView, but it wasn’t a good 
match, at least at that time.  Off the top of my head, I’m not sure it supports 
nested column headers, which is essential for our purposes. Furthermore, in my 
travels around the internet on this subject I’ve seen comments suggesting it 
has its own performance issues, too.  I will revisit it though, just to be sure.

Beyond that, I haven’t seen any other 3rd party libraries along these lines


From: Nir Lisker 
Date: Saturday, 25 January 2020 at 16:40
To: Ed Kennard 
Cc: Kevin Rushforth , 
"openjfx-dev@openjdk.java.net" 
Subject: Re: TableView slow vertical scrolling with 300+ columns

So might it be better to submit a new feature request to develop a separate and 
leaner control entirely, geared much more towards viewing large datasets 
without all the bells and whistles of a TableView?

 Doesn't ControlsFX have that already, or some other 3rd party library?

On Sat, Jan 25, 2020 at 5:34 PM Ed Kennard 
mailto:e...@kennard.net>> wrote:
Hi Kevin, Nir,

I also dug out those two bug reports and agree neither are close enough.  
However, it seems to be general consensus that in order to properly address the 
issue, TableView's virtualisation would need to be changed to support columns 
in addition to rows, and that the extra complexity through the rest of the 
control's features would not be a worthwhile trade-off.

So might it be better to submit a new feature request to develop a separate and 
leaner control entirely, geared much more towards viewing large datasets 
without all the bells and whistles of a TableView?




On 25/01/2020, 15:39, "Kevin Rushforth" 
mailto:kevin.rushfo...@oracle.com>> wrote:

I took a quick look and didn't see one that was close enough to this, so
I think it's worth submitting a new bug report. The closest I found were
JDK-8166956 [1] and JDK-8185887 [2].

I also would be interested to know whether others have run into this in
their applications.

-- Kevin

[1] https://bugs.openjdk.java.net/browse/JDK-8166956
[2] https://bugs.openjdk.java.net/browse/JDK-8185887


On 1/25/2020 2:10 AM, Nir Lisker wrote:
> Hi Ed,
>
> Try to search JBS [1] for this issue. If you don't find one, you can 
submit
> it through bugs.java.com<http://bugs.java.com>, though I suspect this is 
known.
>
> I don't know the technicalities of VirtualFlow in TableView, so can't help
> there.
>
> - Nir
>
> [1] https://bugs.openjdk.java.net/issues/?jql=component %3D javafx
>
> On Sat, Jan 25, 2020 at 3:39 AM Ed Kennard 
mailto:e...@kennard.net>> wrote:
>
>> Hi everyone,
>>
>> I’m new to the list, so by way of a short introduction, I’ve been working
>> with JavaFX for the last 4 years developing a commodities trading risk
>> management system from the ground up for a software company I co-founded 
in
>> London.  All our code is written in Scala, the functional style of which 
is
>> essential for the mathematical heavy lifting needed on the backend, but
>> which also lends itself really well to UI programming and working with
>> JavaFX.  I’m enthusiastic about JavaFX and would love to make a
>> contribution to the project.
>>
>> At the center of our product is an extension of the TableView control
>> that’s responsible for displaying all the output from our pivot reporting
>> engine.  Depending on how the user configures the layout of their pivot
>> reports, sometimes there are a legitimately large number of columns
>> (300+).  When that happens, while the horizontal scrolling remains
>> perfectly smooth, the vertical scrolling degrades to a somewhat juddery
>> state and CPU usage spikes.
>>
>> I found an issue raised about this in 2019 on the old JFX GitHub repo 
here…
>> https://github.com/javafxports/openjdk-jfx/issues/409
>>
>> …but I’m not sure whether, per Kevin’s suggestion at the bottom, it was
>> ever submitted through the correct channels.  I can confirm that the test
>> code included there by “yososs” on 20th May 2019 perfectly illustrates 
the
>> problem I’m experiencing.  The same person seems to have a fairly clear
>> theory on what is causing the problem, too - see their follow-up comment 
on
>> 12 Sept 2019.
>>
>> So, my questions to the list are:
>>
>>
>>1.  Has anyone seen this issue raised anywhere else?
>>2.  If yes, has anyone taken a look into it yet, and possibly even 
found
>> a fix?
>>3.  If no to both of the above, shall I submit it through the correct
>> channels then have a crack at fixing myself?  Or is the issue likely to 
be
>> a much deeper and far-reaching one than I’m anticipating?
>>
>> Many thanks
>>
>> Ed
>>



Re: TableView slow vertical scrolling with 300+ columns

2020-01-25 Thread Ed Kennard
Hi Martin,

Big thank you for your message, and for sharing your code.  I took a look and 
it could definitely be a great starting point for me.  The content we need to 
display is very simple, every cell just needs to display text, occasionally 
with an expand/collapse button on the left.  So I think the only two features 
we rely on from TableView I'd need to add support for are varying cell widths, 
and nested column headers, both of which I imagine will require a lot of 
patience, but I'm definitely going to spend some time looking into it and will 
let you know how it goes.

Ed




On 25/01/2020, 15:52, "Martin Desruisseaux"  
wrote:

Hello Ed

> At the center of our product is an extension of the TableView control 
that's responsible for displaying all the output from our pivot reporting 
engine.  Depending on how the user configures the layout of their pivot 
reports, sometimes there are a legitimately large number of columns (300+).  
When that happens, while the horizontal scrolling remains perfectly smooth, the 
vertical scrolling degrades to a somewhat juddery state and CPU usage spikes.
>
> (…snip…)
> So, my questions to the list are:
>
>1.  Has anyone seen this issue raised anywhere else?
>2.  If yes, has anyone taken a look into it yet, and possibly even 
found a fix?
>3.  If no to both of the above, shall I submit it through the correct 
channels then have a crack at fixing myself?  Or is the issue likely to be a 
much deeper and far-reaching one than I?m anticipating?

By coincidence I'm developing right now a GridView for displaying large 
grids (millions of rows and columns) using JavaFX VirtualFlow. It seems 
to work smoothly up to now. That GridView is specifically designed for 
rendering the sample values of large java.awt.image.RenderedImage using 
its tile management capacity (tiles loaded in background thread when 
first requested). It is not my goal to create a general purpose GridView 
at this time. However it should be possible to remove the 
RenderedImage-specific code and replace it by another model with not too 
much effort. The code is at [1].

About improving TableView for managing thousands of columns, I believe 
that one difficulty is that TableView depends extensively on 
TableColumn, which provides a lot of capability (resizing, sorting, 
reordering, hiding, etc.) at the cost of more complexity that may be 
difficult to optimize. By contrast, above-cited GridView has a lot of 
restrictions (all cells of the same size, no sorting, no reordering, 
etc.) for easier implementation.

 Martin

[1] 
https://github.com/apache/sis/tree/geoapi-4.0/application/sis-javafx/src/main/java/org/apache/sis/gui/coverage




Re: TableView slow vertical scrolling with 300+ columns

2020-01-25 Thread Ed Kennard
Hi Kevin, Nir,

I also dug out those two bug reports and agree neither are close enough.  
However, it seems to be general consensus that in order to properly address the 
issue, TableView's virtualisation would need to be changed to support columns 
in addition to rows, and that the extra complexity through the rest of the 
control's features would not be a worthwhile trade-off.

So might it be better to submit a new feature request to develop a separate and 
leaner control entirely, geared much more towards viewing large datasets 
without all the bells and whistles of a TableView?




On 25/01/2020, 15:39, "Kevin Rushforth"  wrote:

I took a quick look and didn't see one that was close enough to this, so 
I think it's worth submitting a new bug report. The closest I found were 
JDK-8166956 [1] and JDK-8185887 [2].

I also would be interested to know whether others have run into this in 
their applications.

-- Kevin

[1] https://bugs.openjdk.java.net/browse/JDK-8166956
[2] https://bugs.openjdk.java.net/browse/JDK-8185887


On 1/25/2020 2:10 AM, Nir Lisker wrote:
> Hi Ed,
>
> Try to search JBS [1] for this issue. If you don't find one, you can 
submit
> it through bugs.java.com, though I suspect this is known.
>
> I don't know the technicalities of VirtualFlow in TableView, so can't help
> there.
>
> - Nir
>
> [1] https://bugs.openjdk.java.net/issues/?jql=component %3D javafx
    >
    > On Sat, Jan 25, 2020 at 3:39 AM Ed Kennard  wrote:
>
>> Hi everyone,
>>
>> I’m new to the list, so by way of a short introduction, I’ve been working
>> with JavaFX for the last 4 years developing a commodities trading risk
>> management system from the ground up for a software company I co-founded 
in
>> London.  All our code is written in Scala, the functional style of which 
is
>> essential for the mathematical heavy lifting needed on the backend, but
>> which also lends itself really well to UI programming and working with
>> JavaFX.  I’m enthusiastic about JavaFX and would love to make a
>> contribution to the project.
>>
>> At the center of our product is an extension of the TableView control
>> that’s responsible for displaying all the output from our pivot reporting
>> engine.  Depending on how the user configures the layout of their pivot
>> reports, sometimes there are a legitimately large number of columns
>> (300+).  When that happens, while the horizontal scrolling remains
>> perfectly smooth, the vertical scrolling degrades to a somewhat juddery
>> state and CPU usage spikes.
>>
>> I found an issue raised about this in 2019 on the old JFX GitHub repo 
here…
>> https://github.com/javafxports/openjdk-jfx/issues/409
>>
>> …but I’m not sure whether, per Kevin’s suggestion at the bottom, it was
>> ever submitted through the correct channels.  I can confirm that the test
>> code included there by “yososs” on 20th May 2019 perfectly illustrates 
the
>> problem I’m experiencing.  The same person seems to have a fairly clear
>> theory on what is causing the problem, too - see their follow-up comment 
on
>> 12 Sept 2019.
>>
>> So, my questions to the list are:
>>
>>
>>1.  Has anyone seen this issue raised anywhere else?
>>2.  If yes, has anyone taken a look into it yet, and possibly even 
found
>> a fix?
>>3.  If no to both of the above, shall I submit it through the correct
>> channels then have a crack at fixing myself?  Or is the issue likely to 
be
>> a much deeper and far-reaching one than I’m anticipating?
>>
>> Many thanks
>>
>> Ed
>>




TableView slow vertical scrolling with 300+ columns

2020-01-24 Thread Ed Kennard
Hi everyone,

I’m new to the list, so by way of a short introduction, I’ve been working with 
JavaFX for the last 4 years developing a commodities trading risk management 
system from the ground up for a software company I co-founded in London.  All 
our code is written in Scala, the functional style of which is essential for 
the mathematical heavy lifting needed on the backend, but which also lends 
itself really well to UI programming and working with JavaFX.  I’m enthusiastic 
about JavaFX and would love to make a contribution to the project.

At the center of our product is an extension of the TableView control that’s 
responsible for displaying all the output from our pivot reporting engine.  
Depending on how the user configures the layout of their pivot reports, 
sometimes there are a legitimately large number of columns (300+).  When that 
happens, while the horizontal scrolling remains perfectly smooth, the vertical 
scrolling degrades to a somewhat juddery state and CPU usage spikes.

I found an issue raised about this in 2019 on the old JFX GitHub repo here…
https://github.com/javafxports/openjdk-jfx/issues/409

…but I’m not sure whether, per Kevin’s suggestion at the bottom, it was ever 
submitted through the correct channels.  I can confirm that the test code 
included there by “yososs” on 20th May 2019 perfectly illustrates the problem 
I’m experiencing.  The same person seems to have a fairly clear theory on what 
is causing the problem, too - see their follow-up comment on 12 Sept 2019.

So, my questions to the list are:


  1.  Has anyone seen this issue raised anywhere else?
  2.  If yes, has anyone taken a look into it yet, and possibly even found a 
fix?
  3.  If no to both of the above, shall I submit it through the correct 
channels then have a crack at fixing myself?  Or is the issue likely to be a 
much deeper and far-reaching one than I’m anticipating?

Many thanks

Ed