RUVIDEO
Поделитесь видео 🙏

First Steps with Java's New Vector API and JITWatch

Java has a new Vector API and in this video I show the basics of how to use it.

To get everyone on the same page, I start by showing how to prepare the Eclipse IDE. This includes the installation process, installing a couple plugins (Launch Configuration View, and Jeeeyul's Eclipse Themes), and walking through several preferences that I wish someone had told me about earlier.

The new Vector API is still "incubating" so it's no surprise that performance is improving with each new release of the JDK. To highlight the differences, I show how to test your code with Java 16, 17, and 18. Java 18 is not out yet, but nightly builds are available on Shipilev's web site (and other places.)

I share an example of when you might use vectorized (SIMD) code: checksum validation. Telemetry Viewer has a "binary mode" with optional checksums, and this is one area of my code that could use some optimizing. I benchmark my original scalar code against four attempts at vectorizing it. As we'll see, sometimes performance gets better, but other times it gets worse -- sometimes much worse. We'll run across a bug in Java 16, and see how slowly some of the API's fallback implementations perform.

The code is tested in Windows, in a Linux VM, and even on a Raspberry Pi 4. Two versions of Raspberry Pi OS are tested: the default Arm32 (32-bit) version, and the beta AArch64 (64-bit) version. The new vector API does not support Arm32 right now, and we'll see some serious bugs that crashed the JVM when running on a Pi.

With 3 operating systems to test, and 3 versions of Java for each OS, that's a total of 9 different configurations. It would be a pain to manually test changes to the code, but we can use Eclipse's "Launch Group" feature to automate the whole process. It's like a crude CI/CD pipeline.

Finally, I show how to use JITWatch to look at how your source code transforms to Java bytecode and to actual assembly instructions. We can get the runtime to output a log with the disassembly and optimization details by using a handful of flags passed to the JRE. That log can then be parsed by JITWatch, allowing us to see what happened.

OpenJDK does not include the disassembler due to licensing conflicts, so I show to to manually compile the HSDIS DLL. This involves use Cygwin to setup a development environment, and downloading the source code for OpenJDK and Binutils. A Make target is invoked, and after a few minutes the DLL is ready to use.

A text summary of this video is available on my web site:
http://www.farrellf.com/projects/software/2021-11-15_Eclipse_Notes_Javas_Vector_API_and_JITWatch/

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «First Steps with Java's New Vector API and JITWatch», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.