Summary
Implement a Java 2D internal rendering pipeline for macOS using the Apple Metal API as alternative to the existing pipeline, which uses the deprecated Apple OpenGL API.
Jul 17, 2020 I used jMeter which is an open source software, 100% pure Java application designed to test performance and simulate virtual Users. It was originally designed for testing Web Applications but has since expanded to other test functions. This software can be installed on any server or workstation to quickly design load test script. Jun 07, 2019 iBench is a free and open source benchmarking application for running comprehensive benchmark tests on Macs. It contains 12 integer workload and 9 floating point tests which it uses to evaluate the memory subsystem and CPU performance of your computer.
Goals
Provide a fully functional rendering pipeline for the Java 2D API that uses the macOS Metal framework.
Be ready in the event Apple removes the deprecated OpenGL API from a future version of macOS.
Ensure transparency of the new pipeline to Java applications.
Ensure functional parity of the implementation with the existing OpenGL pipeline.
Provide performance as good or better than the OpenGL pipeline in select real applications and benchmarks.
Create a clean architecture that fits into the existing Java 2D pipeline model.
Co-exist with the OpenGL pipeline until it is obsolete.
Non-Goals
It is not a goal to remove or disable the existing OpenGL pipeline.
It is not a goal to add any new Java or JDK APIs. This is all internal implementation.
Motivation
Two major factors motivate the introduction of a new Metal-based rendering pipeline on macOS:
Apple deprecated the OpenGL rendering library in macOS 10.14, in September 2018. Java 2D on macOS is completely reliant on OpenGL for its internal rendering pipeline, so a new pipeline implementation is needed.
Apple claims that the Metal framework, their replacement for OpenGL, has superior performance. For the Java 2D API, this is generally the case with some exceptions.
Description
Most graphical Java applications are written using the Swing UI toolkit, which renders via the Java 2D API. Internally, Java 2D can use software rendering plus a blit to the screen or it can use a platform-specific API, such as X11/Xrender on Linux, Direct3D on Windows, or OpenGL on macOS. These platform-specific APIs typically offer much better performance than software rendering, and generally off-load the CPU. Metal is the new macOS platform API for such rendering, replacing the deprecated OpenGL API. (The name has nothing to do with the Swing 'Metal' Look and Feel; that is just a coincidence.)
We created a substantial amount of new internal implementation code to use the Metal framework, just as we already had for the other platform-specific APIs. Whilst easily fitting into the existing framework the new code is much more modern in its use of graphics hardware, making use of shaders rather than a fixed function pipeline.The changes are confined to macOS-specific code and even there only a minimal amount of code shared between Metal and OpenGL is updated. We did not introduce any new Java APIs, nor did we change any existing API.
Most graphical Java applications are written using the Swing UI toolkit, which renders via the Java 2D API. Internally, Java 2D can use software rendering plus a blit to the screen or it can use a platform-specific API, such as X11/Xrender on Linux, Direct3D on Windows, or OpenGL on macOS. These platform-specific APIs typically offer much better performance than software rendering, and generally off-load the CPU. Metal is the new macOS platform API for such rendering, replacing the deprecated OpenGL API. (The name has nothing to do with the Swing 'Metal' Look and Feel; that is just a coincidence.)
We created a substantial amount of new internal implementation code to use the Metal framework, just as we already had for the other platform-specific APIs. Whilst easily fitting into the existing framework the new code is much more modern in its use of graphics hardware, making use of shaders rather than a fixed function pipeline.The changes are confined to macOS-specific code and even there only a minimal amount of code shared between Metal and OpenGL is updated. We did not introduce any new Java APIs, nor did we change any existing API.
The Metal pipeline can co-exist with the OpenGL pipeline. When a graphical application starts up, one or the other is chosen. For now, OpenGL remains the default. Metal is used only if it is specified on startup or if the initialization of OpenGL fails, as would happen in a future version of macOS with no OpenGL support.
Race Tests 001 Mac Os Catalina
At the time of integration of this JEP, Apple have yet to remove OpenGL.Until that happens an application can opt-in to Metal by specifying -Dsun.java2d.metal=true
on the java
command line. We will make the Metal rendering pipeline the default in a future release.
Prior to integration in the JDK, we conducted work on this JEP in Project Lanai.
Testing
Race Tests 001 Mac Os 7
Rogue empire: the prelude mac os. Testing the functionality of the new pipeline did not require new functional test development, since no Java 2D APIs were changed. Existing tests and real-world applications sufficed. These included:
- JDK jtreg regression tests,
- JCK Tests,
- Java 2D and Swing Demos, and
- IDEs such as Intellij IDEA and Netbeans, as examples of large-scale real world applications.
To test performance, we used:
Race Tests 001 Mac Os X
- J2DBench, a Java 2D benchmarking application included in JDK,
- RenderPerfTest, a custom stress test that renders multiple objects of the same primitive type and measures frames per second (FPS) developed in Project Lanai, and
- IntelliJ IDEA IDE performance.
Performance results for the final planned early-access release are here.
To further verify the new pipeline, we used macOS Xcode instrumentation tools to check for leaks and for correct Metal API usage.
Risks and Assumptions
We tested on a variety of hardware and macOS versions which are presumed to be representative, but not all combinations were available. Since we could not account for all scenarios, it is possible that performance limitations remain.
We did very limited (sanity) testing of the current x64 binaries on Apple Silicon. No port of the JDK to Apple Silicon is yet available to support native testing.
Metal does not support the XOR operation, so we had to accept lower performance in that niche case. That is likely to remain so until such time as Metal provides direct support for XOR.
Android is a highly customizable and developer-friendly OS. To facilitate system diagnosis and test, it supports a range of hidden codes. While many of these codes work on all devices, some Android skins like One UI, Color OS, Oxygen OS, MIUI, FunTouch OS, etc. have their own set of secret codes. In this article, I will list all Samsung secret codes that work on the older TouchWiz Nature and Grace UX and the latest One UI. Using these codes, you can enter Samsung engineering mode, test the network, diagnose the hardware and get key information about your Samsung phone to Galaxy Tab.
Whether you own a Samsung Galaxy S5, S6, S7, S8, S9, S10, S20, Note 4, Note 5, Note 9, Note 10, Note 20, Galaxy A, J, or M series phone or a Galaxy Tab, the secret codes given below should work on all devices. However, you must keep in mind that the Samsung codes differ from device to device. Also, the code that works on one software version might not work on the other.
On most of the older Galaxy devices running TouchWiz, you can even use Samsung secret codes to unlock SIM. I remember unlocking my AT&T Galaxy S5 using a secret hack. However, as soon as Samsung comes to know about such hacks, they take no time to path them with a new software update.
Samsung Secret Codes List
If you own a Samsung phone that was released after 2017, you can try the following secret codes on your device. Samsung Galaxy S8, S9, S10, S20, Galaxy Note 9, Note 10, Note 20, Galaxy A and M series, Galaxy Tab S series, etc. come into this category. Using the secret code, serial number, and IMEI, you can even check the manufacturing and activation date of your Samsung device.
Don't Miss: Best Free Themes for Samsung Devices
List of Samsung Codes for Samsung One UI
Samsung Secret Code (One UI) | Secret Code Function |
*#06# | Check the IMEI number any mobile phone or tablet |
*#0*# | Test RGB (Red Blue Green), Receiver, Vibration, Touch sensitivity, Speakers, Camera Sensors, S-Pen, Audio loopback, Software version, etc. |
*#0808# | Change USB settings |
*#0228# | Check Battery status ADC, RSSI reading, etc. |
*#0011# | View GSM status information |
*#2222# | Check Hardware Version |
*#1234# | View Software Version such as PDA, CSC, MODEM, etc. Helps you check the BL, AP, CP, and CSC of your Samsung device |
*#9090# | Check diagnostic configuration |
*#9900# | Check Dump mode |
*#12580*369# | Check Software and hardware information. This code also lets you check Samsung mobile manufacturing date |
*#0283# | Check Audio loopback control |
*#34971539# | Update Camera firmware |
#7465625*638*# | Check Network lock keycode |
*#2663# | Check TSP and TSK firmware update |
*#272IMEI#* | Check Product code |
*#272*IMEI# | Check buyer code, CSC (Country/Carrier Specific Product) Code |
*#0283# | Check Audio loopback control |
*#1111# | Check software version |
*#34971539# | View Camera firmware menu |
*43# [dial] | Enable call waiting |
#43#[dial] | Turn off call waiting |
*#43#[dial] | Show status of call waiting |
*135#[dial] | Request own phone number (doesn't work sometimes) |
**04*[old Pin]*[new Pin]*[new Pin]# | Change device PIN. Replace the old and new PINs of your Samsung device. |
*#004*[number]# | Divert call to a given number. Replace '[number]' with a phone number |
*#004# | Request the status for call diversion |
#004# | Deactivate call diversion |
##004# | Erase call diversion |
List of Codes for Old TouchWiz Devices
In case you an older Samsung phone or tablet such as Galaxy S4, S5, S6, S7, Note 4, Note 5, Note 6, Note 7, Galaxy J and C series, etc. and it runs on TouchWiz or Android 6.0 or below, you should try the codes described below.
Samsung Secret Code (TouchWiz) | Secret Code Function |
*#0*# / *#*#0*# | Test RGB (Red Blue Green), Receiver, Vibration, Touch sensitivity, Speakers, Camera Sensors, S-Pen, Audio loopback, Software version, etc. |
*#06# | Show IMEI Number |
*#03# | NAND Flash the serial number |
*#80# | Touchscreen noise test (warning do not press power button) |
*#251# | Wakelock OFF |
*#251# | Wakelock ON |
*#526# | WLAN Engineering Mode |
*#528# | WLAN Engineering Mode |
*#745# | RIL Dump Menu |
*#746# | Debug Dump Menu |
*#0011# | Service Mode |
*#0228# | Battery status |
*#0283# | Audio packet loopback test |
*#0289# | Audio/speaker-test (Melody Test Mode) |
*#0514# | SysDump (System Dumps, logs, etc.) |
*#0588# | Proximity Sensor test |
*#0589# | Light Sensor Test Mode |
*#0673# | Audio/speaker-test (same as *#0289#) |
*#0782# | Real-time clock test |
*#0842# | Vibration test |
*#1575# | GPS Control Menu |
*#2263# | RF Band Selection |
*#2663# | Touchscreen FW and version |
*#2664# | HW touchscreen test |
*#3264# | RAM check (version number) |
*#7769# | Proximity sensor test |
*#7284# | Phone utility and USB driver and connectivity settings |
*#7353# | Performs 12 types of function tests |
*#7594# | Factory mode / Enable shutdown on long press |
*#8888# | Service Mode (Read FTA hardware version) |
*#9900# | System Dump Mode |
*#9999# | Software versions (AP, CP, CSC, FTA SW) |
*#2222# | Hardware version |
*#1234# | View SW Version PDA, CSC, MODEM |
*#0228# | Battery diagnostics |
*#9090# | Service Mode |
*#301279# | HSDPA/HSUPA Control Menu |
*#4238378# | GCF Configuration |
*#197328640# or *#*#197328640#*#* | Enabling test mode for service activity (also shows the manufacturing date of Samsung devices) |
*#232331# | Bluetooth test |
*#232337# | Bluetooth address |
*#232338# | WLAN MAC address & PS mode |
*#232339# | WLAN Engineering Mode test (TX & RX modes) (same as *#526*) |
*#8736364# | Opens OTA update menu |
*#7412365# | Camera firmware standard (Front/Rear camera firmware) |
*#7465625# | Personalization (lock status settings) |
*#22558463# | Reset Total Call Time |
*#12580*369# | Main Version (AP, CP, CSC, RF cal, HW revision) |
*#3282*727336*# | System and storage information, and Data usage statistics |
* 2767 *3855# | Wipes Samsung phone completely |
*#*#7780#*#* | Resets your phone to the factory state and deletes only apps and app data. You don't need to boot into the Samsung recovery mode to do that. |
*#*#7594#*#* | Enables direct power off without showing Power Menu when you hold the Power button |
*#*#232338#*#* | Displays Wi-Fi MAC address |
*#*#4986*2650468#*#* | PDA, Phone, Hardware, RF Call Date (or manufacturing date) firmware info |
##778 [dial] | View the EPST menu |
Race Tests 001 Mac Os X
Whether you want to check the manufacturing date of your Samsung device, get into the Samsung engineering mode, test network, unlock SIM, the Samsung secret codes cal help you with diagnosing your device. Also, if these codes work on your phone or tablet, you can be sure that it's original. You can download the list of secret codes PDF file for future reference if you want.
Read Next: How to Uninstall Samsung System App without Root