WebKit (non native) HTMLViewer performance Win7 vs Win10?

Pardon my ignorance if this is a known issue, but does anybody know if (and why) WebGL in a HTMLViewer under Windows 7 runs 12x smoother than under Windows 10?

I left a WebGL simulation run for a minute in a 800x600 window on 4 computers (1 with W7 and 3 with W10) and it’s super stable in all 4 computers, regardless of the OS, but surprisingly, all W10 computers show ATROCIOUS performances when running the WebGL simulation in Xojo and no issue at all when directly run in Firefox or Edge. The 10 years old W7 computer steadily shows excellent performance both in Xojo (HTMLViewer) and in the native browser (Firefox). We’re talking magnitudes slower under Windows 10 compared to Windows 7. Approximately 12 TIMES slower:

On a 10 years old Windows 7 PC, the Xojo web simulation steadily runs at full frame rate (60fps) and steadily only uses 10% of the (decade old) CPU.

On a 4 years old Windows 10 PC, the same Xojo web simulation steadily runs at 5fps (yes, five) and uses 66% of the CPU (steadily). Just to be sure, I tried on 3 different Windows 10 PC and the results are astonishingly the same.

All computers have a dedicated graphics card that is magnitudes faster than what the simple WebGL simulation requires and they can all run the same simulation in the native browser (Firefox or Edge) outside of Xojo at full frame rate. But only the Windows 10 PC’s almost max out their CPU and offer only a handful of frames per second when using the HTMLViewer control for no apparent reason. This seems like a compatibility bug to me. The app is the same, only the OS makes a 12 TIMES performance difference.

Any idea what causes this and/or how to solve this on W10 PC’s?

Some background

For years, HTMLViewers used a control based on IE because that’s what was made available by Windows. This old control didn’t have a recent version of JavaScript.

Then Microsoft crated a new engine based on what’s in (Chromium based) Edge. This new control was first deployed on Windows 10 and later on Windows 7.

You wrote that all 4 computers have dedicated graphics cards. Is it possible that some use dedicated memory and others use shared memory ? That may do a difference. Still on the graphics cards subject, it’s not because there is dedicated graphics card that it is used. For example I have a Dell Laptop whose i5 processor has a build in Intel graphics card and an Nvidia card. The Nvidia card is only used for graphics intensive applications.

One other question. Do all the 4 computers have the same amount of Ram ?

Hi Gilles! All 4 computers are ATX towers with quite high end GPU’s (at least for the time they were sold). No laptop or APU in the equation.

One of the W10 PC has 16GB of RAM and an AMD Ryzen 5 CPU (6-core, 3.6ghz). The other two W10 PC’s are identical, 8GB of RAM and a Core-i7 CPU (4-core, 3.2ghz).

The old W7 PC that renders the WebGL simulation 12 TIMES faster than any of the aforementioned W10 PC’s is an old AMD FX-8350 CPU (8-core, 4.0ghz) with 32GB of RAM.

The WebGL simulation uses 71MB of RAM in cefsubproc.exe, so I doubt having 8GB, 16GB or even 32GB of RAM changes anything whatsoever. It really looks like a compatibility bug and a nasty regression one if I may add.

Just to make sure that I answer your question correctly, how would I check on all PC’s if they use shared memory or not? (I don’t see why they would but just to make sure)

You would have to check specifications for the graphics cards.

Put a large CEF HTMLViewer on a window, set its Opening event to:

me.LoadURL("chrome://gpu")

Compare what you see in those machines.

Have you enabled both registry flags?

  • HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION
  • HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_GPU_RENDERING

Also,
Test in IE11, not in Chrome or Edge, since the IE11 engine is what Xojo’s native HTMLViewer will use (if you properly set the 2 registry flags above).

And finally, since it is using the IE11 engine, make sure the PCs are updated - updates to IE11 will flow through.

How is this related to this topic?

2 Likes

Possibly not to the topic you raised - @Gilles_Plante mentioned the IE rendering engine, so I’m responding to that.

For the record, modern IE11 (or the Native Xojo HTMLViewer) does a fine job with WebGL, if properly configured.

But it sounds like you are using CEF only, in which case you can ignore my comments :slight_smile:

He wrote that for years, Xojo used IE. This is not the case anymore and no, WebGL doesn’t work under native HTMLViewer under Windows 7. Anyway, back to the topic, as stated in the title, we’re talking about WebKit HTMLViewer, the one that is based on Chrome (not IE) and that replaces the native browser. Yes I am using CEF.

Details coming, gathering the DATA now.

Here’s what’s probably happening: WebGL itself will let you create a context that is software rendered - you can detect this at runtime via JavaScript.

See failIfMajorPerformanceCaveat here: HTMLCanvasElement.getContext() - Web APIs | MDN

It absolutely does (this is off topic, but I can link you to my commercial app which renders under WebGL under a Xojo HTMLViewer under Windows 7) if you’d like an example

OK but why would it render 12 TIMES faster on a 10 years old Windows 7 PC compared to 3 more modern Windows 10 PC’s? This makes no sense whatsoever. An AMD Ryzen 5 is faster than a decade old AMD FX-8350, yet the decade old FX-8350 renders 12 TIMES faster (60fps, compared to 5fps on the Ryzen). Anyway, I highly doubt it’s software rendered, why would it only software render under W10 and work flawlessly under W7, this makes no sense? But I’ll follow both your link and finish gathering DATA for Rick and we’ll see.

I’ve dealt with situations like this a lot. My first guess would be GPU Drivers - drivers on Windows are a mess, and although Windows 10 now manages GPU drivers by default, it often installs fairly old drivers, so it could be that your Windows 7 PC has a better driver than the Windows 10 PC?

For a quick test, to isolate whether it’s Xojo, CEF, or your WebGL code, I would recommend trying some of the demos at three.js examples : this might help narrow down whether the problem is “All WebGL on this Windows 10PC is slow” vs. some other issue.

That is basically what I’ve been doing today already and that’s how I came to the conclusion that all W10 PC’s we have here render at 5fps while the decade old W7 PC renders at full frame rate (60fps). There’s definitely a compatibility problem with graphics acceleration under Xojo on W10. As per stated in the first post above, the same demo runs at full frame rate in Firefox and Edge on the same W10 PC’s.

OK, I have gathered the DATA on all 4 PC’s. All the W10 PC’s report “Canvas: Software only, hardware acceleration unavailable” while the W7 PC reports “Canvas: Hardware accelerated”.

All W10 PC’s run AAA games no problem and the same WebGL demo runs at full frame rate in Firefox and Edge on those W10 PC’s. It’s only from the HTMLViewer in Xojo that it falls back to software rendering. That is the issue, now how can this be solved? :face_with_raised_eyebrow:

1 Like

Good detective work - most of my experience is getting high performance out of WebGL via the IE11 renderer in Xojo 2019 using HTMLViewer, and I have basically zero experience with the Chromium / CEF HTMLViewer option. That being said, here are the things I would try:

  • What version of Xojo? Each Xojo usually updates the CEF library version.
  • are the window sizes and canvas sizes the same? Under WebGL the canvas has a size which can be different than the window size; mismatches can cause bad performance. For example, if you are rendering a large window, and the pixel scale is at 2x, you may be rendering 4x as many pixels.
  • searching my Xojo code for “WebGL” i found this note:
#if TargetWin32
me.DoubleBuffer = False // WARNING: doubleBuffer = true will break WebGL GPU rendering on Win32
#endif

What version of Xojo?
I purchased Xojo 2021r3.1 just 2 months ago and I’m completely new to Xojo. That’s what I’m using today. (Been using RealBasic for at least 20 years prior to that, all the way back to RealBasic 1.0 under Mac OS 8 in the late 90’s WAY before WebGL was even a thing!)

Are the window sizes and canvas sizes the same?
Yes and I’ve tried with a tiny 400x400 window but it makes almost no difference (8fps instead of 5fps).

Searching my Xojo code for “WebGL” i found this note: me.DoubleBuffer …
What is “me” referring to? The HTMLViewer?

In my case, it was ContainerControl.DoubleBuffer = true causing the issue. Is your HTMLViewer on a window directly, or does it have a parent (such as a Canvas or ContainerControl) which might have DoubleBuffer true?

No, it’s just on a window, nothing behind or in front of it, not in a group of control or anything weird. It’s directly added to a window with nothing else on it (at the moment). Remember that the issue here is that all W10 PC’s have the hardware acceleration disabled under my Xojo app for some reason. The same app, same exact built .exe is launched under W7 and it DOES have hardware acceleration enabled.

Loading the chrome://gpu URL from my built Xojo app reports on all W10 PC’s: “Canvas: Software only, hardware acceleration unavailable” while the W7 PC reports “Canvas: Hardware accelerated”.

Interesting, here’s what I see:

  • within a HTMLRenderer set to WebKit

  • chrome://gpu shows WebGL: Software Rendering Only

  • I see this problem with Xojo 2019 in both 32 and 64 bit builds

  • however, in Xojo 2022r1.1, I am getting hardware rendering:
    image

Can you try Xojo 2022r1.1 ?

1 Like