-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Investigate moving additional performance-critical pieces of the TurboVNC Viewer into the TurboVNC Helper JNI library #144
Comments
Moving the entire Tight decoder into JNI is problematic, because the decoder interleaves decoding and reading from the network. It will be necessary to work around that in the context of implementing multi-threaded decoding. Meanwhile, however, the most straightforward path seems to be to move only the JPEG and zlib decoding operations into the helper. The former would be done primarily to simplify the build, since it wouldn't be necessary for the build system to re-package the libjpeg-turbo JAR and JNI libraries anymore. The latter would be done primarily to take advantage of the SIMD-accelerated zlib implementation. |
Removing from the "Windows TurboVNC Viewer Migration" milestone, since this doesn't technically represent a feature regression. |
The ability to use TurboJPEG through JNI was introduced with the overhaul of the Java TurboVNC Viewer in TurboVNC 1.2, but the TurboVNC Helper wasn't introduced until TurboVNC 2.0 and wasn't available on all supported platforms until TurboVNC 2.2. The TurboVNC build system also had the ability to sign the TurboJPEG JNI JARs using the same certificate that was used to sign the TurboVNC Viewer JAR, thus allowing those JARs to be packaged with the TurboVNC Server and deployed automatically to Linux, Mac, and Windows clients via Java Web Start (whereas doing likewise with the TurboVNC Helper would have created a chicken-and-egg dilemma.) Thus, it made sense historically to use a separate JNI library for TurboJPEG. However, since Java Web Start is no longer a thing and the TurboVNC Helper is built by default on all supported platforms, there is no longer any need to use a separate JNI library for TurboJPEG. To that end, this commit creates a dedicated JNI wrapper for the TurboJPEG C API and includes it in the TurboVNC Helper library. The main purpose of this commit at the moment is to streamline the build and allow distribution-specific builds of the TurboVNC Viewer on Linux distributions that provide the TurboJPEG C API but not the TurboJPEG Java API (including RHEL/CentOS 7 via EPEL, RHEL/CentOS 8 via CodeReady/PowerTools, recent Ubuntu releases, and Fedora.) However, it also lays the groundwork for moving the entire Tight decoder into the Helper, which is a long-term project goal (refer to #144.)
The ability to use TurboJPEG through JNI was introduced with the overhaul of the Java TurboVNC Viewer in TurboVNC 1.2, but the TurboVNC Helper wasn't introduced until TurboVNC 2.0 and wasn't available on all supported platforms until TurboVNC 2.2. The TurboVNC build system also had the ability to sign the TurboJPEG JNI JARs using the same certificate that was used to sign the TurboVNC Viewer JAR, thus allowing those JARs to be packaged with the TurboVNC Server and deployed automatically to Linux, Mac, and Windows clients via Java Web Start (whereas doing likewise with the TurboVNC Helper would have created a chicken-and-egg dilemma.) Thus, it made sense historically to use a separate JNI library for TurboJPEG. However, since Java Web Start is no longer a thing and the TurboVNC Helper is built by default on all supported platforms, there is no longer any need to use a separate JNI library for TurboJPEG. To that end, this commit creates a dedicated JNI wrapper for the TurboJPEG C API and includes it in the TurboVNC Helper library. The main purpose of this commit at the moment is to streamline the build and allow distribution-specific builds of the TurboVNC Viewer on Linux distributions that provide the TurboJPEG C API but not the TurboJPEG Java API (including RHEL/CentOS 7 via EPEL, RHEL/CentOS 8 via CodeReady/PowerTools, recent Ubuntu releases, and Fedora.) However, it also lays the groundwork for moving the entire Tight decoder into the Helper, which is a long-term project goal (refer to #144.)
I performed a new round of viewer benchmarks using:
on three test machines (each with a different GPU make) and four operating systems:
Results:
Conclusions:
|
In general, my strategy is going to be:
For now, I'm closing this issue, since it has been proven to be much less relevant than I initially thought. |
The Linux blitting performance with |
Most of the cosmetic issues caused by disabling Swing double buffering have now been fixed in d2ffd4a. (The only known issue that remains is #224, which is more minor.) That took almost all of what little wind remained in the sails for this feature. Since #60 is the only remaining impetus, any further discussion of moving the Tight decoder into JNI will be conducted there. |
Now that there is a TurboVNC Helper library on all platforms we support, the potential exists to improve the performance of the standalone Java TurboVNC Viewer (which will be the only TurboVNC Viewer in the next major release of TurboVNC) by moving more functionality into the TurboVNC Helper:
In keeping with the tradition of the TurboVNC Helper, these features would be optional. It would still be possible to use VncViewer.jar without the helper (but with reduced performance.)
The text was updated successfully, but these errors were encountered: