Since you looked into it I'm curious: - Is the CSS parsing/loading offloaded to another thread? Or is there no other meaningful "startup" work that could be done?
- Could CSS be loaded in parallel if it was split? - Was there any low hanging fruit that could speed up parsing of regular CSS files? - What are the challenges in maintaining the binary path? I would think it shouldn't need any adjustment, but I fear that it probably does for every new value type introduced... ideally these paths would converge before types get involved. I'm certainly not attached to the binary code path; ideally, a binary path should be low maintenance, and work more like a cache instead of a different supported format. --John On 20/12/2025 05:56, Michael Strauß wrote: > Hi all, > > I ran some numbers on the JavaFX binary CSS (BSS) feature. For the > measurements, I used CssParser to parse modena.css and modena.bss into > a Stylesheet instance. > > On a cold start, parsing takes ~150 ms for the CSS file and ~100 ms > for the BSS file (about a 50% improvement for BSS). Using JMH to > benchmark warmed-up performance, I get ~4.4 ms for CSS and ~1.7 ms for > BSS (about 2.6x faster for BSS). > > Those results are a meaningful improvement, but the downside is the > added complexity: the binary path introduces non-trivial code that has > to be maintained over time, and it tends to slow down or complicate > new feature work significantly. > > My current hypothesis is that this is largely irrelevant for most > applications in practice, because modena.css is likely the only > stylesheet that ever benefits from the binary path. BSS doesn't come > "for free"; projects have to run css2bin as part of their build, and I > suspect most applications won't do that. So in the common case, the > only stylesheet parsed via BSS is Modena, where both modena.css and > its prebuilt modena.bss ship with the JavaFX runtime. > > Maybe in 2010, BSS was a meaningful improvement for mobile devices. > But today, these gains are dwarfed by overall JavaFX and JVM startup > time. Removing the binary path would free up development resources for > features that actually matter for JavaFX applications. > > Thoughts?
