How Hardcoder Boosts Android App Performance with Direct Hardware Scheduling

Hardcoder is an open‑source Android framework that creates a direct communication channel between apps and device hardware, enabling precise CPU, core, and GPU resource scheduling to boost performance by up to 30 % while adding only minimal power overhead.

WeChat Client Technology Team
WeChat Client Technology Team
WeChat Client Technology Team
How Hardcoder Boosts Android App Performance with Direct Hardware Scheduling

The Birth of Hardcoder

As WeChat becomes more complex, performance optimization becomes harder and the gains less noticeable, prompting the search for a new approach beyond software.

After learning that some manufacturers use aggressive CPU frequency boosting when detecting WeChat launch or page switches, the team realized that such “brute‑force frequency scaling” is imprecise and can increase power consumption.

Thus they created Hardcoder, a framework that opens a direct channel between the app and the hardware, bypassing the Android framework to let the hardware schedule resources according to app needs.

What is Hardcoder

Current Android frameworks cannot accurately know when an app needs resources, so manufacturers’ brute‑force frequency scaling is ineffective. Hardcoder builds a reliable communication bridge between the app and the system (ROM), allowing the app to request hardware resources such as CPU frequency, big‑core binding, GPU frequency, etc., in real time.

It also enables functions not covered by standard Android APIs, facilitating device‑specific adaptation and feature expansion.

Hardcoder Framework Communication Process

The framework consists of a Server side on the OEM system and a Client side packaged as an AAR integrated into the app.

When the app needs resources, it sends a request to the Hardcoder Client, which forwards it to the Server. The Server then requests the appropriate hardware resources (e.g., raise CPU frequency, bind threads to big cores). The system can also push its current state back to the client, enabling two‑way communication.

Communication uses a native LocalSocket implementation based on Linux socket APIs.

Applicable Scenarios and Effects

Hardcoder significantly speeds up heavy scenarios such as WeChat launch, video sending, and mini‑program startup, improving scroll smoothness in Moments. Average performance gains range from 10 % to 30 %.

Because WeChat can more precisely control resource allocation, the performance boost comes with only about a 2 % increase in power consumption, roughly a 20 % performance gain for a 2 % energy cost.

Hardcoder is already integrated with major OEMs (OPPO, Vivo, Huawei, Xiaomi, Samsung, Meizu), covering over 460 million devices.

Hardcoder Open Source

Following Tencent’s open‑sharing philosophy, Hardcoder has been adopted by internal apps such as Mobile QQ, Enterprise WeChat, and Daily Quick News, delivering 10 %‑50 % average improvements in launch, chat opening, and image sending.

The framework is now open‑sourced on GitHub: http://github.com/Tencent/Hardcoder.git

How to Use Hardcoder

Read the Hardcoder technical solution documentation to understand the architecture.

Use the provided testapp to quickly try Hardcoder and verify its effect.

Integrate Hardcoder into your app:

Download the Hardcoder project and compile the AAR.

Add the AAR to your build.gradle.

Call initHardCoder at process start to establish the socket connection.

After initHardCoder succeeds, call checkPermission with the app’s vendor‑granted permissions.

When a resource‑intensive scene occurs, invoke startPerformance with the required parameters; ensure the socket is connected (check HardCoderJNI.isConnect() if needed).

When the scene ends, call stopPerformance with the hashCode returned by startPerformance.

Test performance by comparing the app with Hardcoder enabled versus disabled.

Apply for online permissions from the OEM; see the FAQ for details.

Release the app with Hardcoder functionality.

Additional Documentation

Hardcoder Product Solution Introduction: https://github.com/Tencent/Hardcoder/wiki/Hardcoder-产品方案介绍

Hardcoder Technical Solution Introduction: https://github.com/Tencent/Hardcoder/wiki/Hardcoder-技术方案介绍

Hardcoder Testapp Guide: https://github.com/Tencent/Hardcoder/wiki/Hardcoder-Testapp测试指南

Hardcoder Integration Guide: https://github.com/Tencent/Hardcoder/wiki/Hardcoder-接入指南

FAQ: https://github.com/Tencent/Hardcoder/wiki/FAQ

mobile developmentAndroidHardcoderCPU FrequencyHardware Scheduling
WeChat Client Technology Team
Written by

WeChat Client Technology Team

Official account of the WeChat mobile client development team, sharing development experience, cutting‑edge tech, and little‑known stories across Android, iOS, macOS, Windows Phone, and Windows.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.