Fundamentals 16 min read

Explore Tencent’s High‑Performance Open‑Source Components for Modern Development

This article introduces a curated collection of Tencent’s high‑performance open‑source components—including a mmap‑based key‑value store, an API‑centric JSON framework, cross‑platform libraries, a mobile‑optimized neural network engine, hot‑patch solution, coroutine library, plugin framework, cross‑platform UI framework, mini‑program toolkit, and an IoT real‑time OS, each with core features and project links.

Architect's Guide
Architect's Guide
Architect's Guide
Explore Tencent’s High‑Performance Open‑Source Components for Modern Development

High‑Performance General Key‑Value Component

MMKV is a key‑value component based on mmap memory mapping, using protobuf for serialization. It offers high performance and strong stability, used in WeChat since 2015 and now open‑sourced for Android, macOS, Win32, POSIX.

MMKV Principles

Memory preparation Uses mmap to map a file into memory, providing a writable memory block that the OS flushes to file, ensuring data persistence even after crashes.

Data organization Serializes data with protobuf, which balances performance and size.

Write optimization Supports frequent incremental writes by appending serialized kv objects to the memory tail.

Space growth Append‑based updates can cause uncontrolled file growth, requiring a trade‑off between performance and space.

Project address

Open‑source: https://github.com/Tencent/MMKV

APIJSON

APIJSON is a JSON‑based network transmission protocol and ORM library designed for APIs. It provides fully automated CRUD, complex queries, and simple transaction operations, greatly reducing development and communication costs. It suits small‑to‑medium front‑back separation projects, especially BaaS, Serverless, internet startups, and internal enterprise projects.

For Frontend

No need to chase backend interfaces or request docs.

Data and structure are fully customizable.

Requests reveal results directly.

One call can fetch any data in any structure.

Eliminates duplicate data, saving bandwidth and speeding up.

For Backend

Provides generic interfaces, reducing API implementation effort.

Auto‑generates documentation, eliminating manual maintenance.

Auto‑validates permissions, manages versions, and prevents SQL injection.

Open API remains compatible without version splits.

Supports CRUD, fuzzy search, regex matching, remote functions, etc.

Project address

GitHub: https://github.com/Tencent/APIJSON

Cross‑Platform Cross‑Business Terminal Base Component

Mars is Tencent’s cross‑platform, cross‑business terminal base component.

comm: independent public library including socket, thread, message queue, coroutine, etc.

xlog: high‑reliability, high‑performance runtime logging component.

SDT: network diagnostic component.

STN: signaling distribution network module, the core of Mars.

Project address

Open‑source: https://github.com/Tencent/Mars

High‑Performance Neural Network Forward Computing Framework

ncnn is a high‑performance neural network inference framework optimized for mobile devices. It has no third‑party dependencies, is cross‑platform, and runs faster on mobile CPUs than any known open‑source framework. It powers many Tencent apps such as QQ, Qzone, WeChat, and others.

Features

Supports CNNs, multiple inputs, and branch structures.

No third‑party library dependencies (no BLAS/NNPACK).

Pure C++ implementation, cross‑platform (Android, iOS, etc.).

ARM NEON assembly‑level optimizations for speed.

Fine‑grained memory management and low memory footprint.

Multi‑core parallel acceleration with ARM big.LITTLE scheduling.

Supports Vulkan GPU acceleration with low overhead.

Library size under 700 KB, can be trimmed below 300 KB.

Project address

Open‑source: https://github.com/Tencent/ncnn

Android Hot‑Patch Solution

Tinker is WeChat’s official Android hot‑patch solution, enabling dynamic delivery of code, .so libraries, and resources so apps can update without reinstalling. It also supports updating plugins.

Key components:

Gradle build plugin: tinker-patch-gradle-plugin

Core SDK library: tinker-android-lib

Command‑line version for non‑Gradle users: tinker-patch-cli.jar

Project address

GitHub: https://github.com/Tencent/tinker

C/C++ Coroutine Library

libco is a C/C++ coroutine library heavily used in WeChat’s backend, running stably on tens of thousands of machines since 2013.

It provides a few functions (co_create, co_resume, co_yield, co_poll) to support synchronous or asynchronous programming, and includes socket hooks for easy async conversion.

Features

Non‑intrusive conversion of multi‑process/thread services to coroutine services, boosting concurrency.

Supports CGI framework for building web services.

Integrates common third‑party libraries (gethostbyname, mysqlclient, ssl, etc.).

Optional shared‑stack mode for millions of connections on a single machine.

Simple, clean coroutine programming interface.

Pthread‑like API (co_create, co_resume, etc.).

Thread‑local coroutine variables and semaphore (co_signal).

Lambda‑style language support for inline async tasks.

Lightweight network framework based on epoll/kqueue and a high‑performance timer wheel.

Project address

Open‑source: https://github.com/Tencent/libco

Android Plugin Framework

Shadow is Tencent’s self‑developed Android plugin framework, proven by billions of users online. It shares core plugin technology code and complete deployment designs.

Key characteristics:

Reuses independent app source code; plugin apps can run as normal apps.

Zero reflection, no hacks; avoids hidden API usage.

Fully dynamic framework; plugin code is part of the framework.

Minimal host overhead (≈15 KB, ~160 methods).

Core implemented in Kotlin for concise, maintainable code.

Project address

GitHub: https://github.com/Tencent/Shadow

New Cross‑Platform Development Framework

Hippy is a cross‑platform framework allowing a single codebase to run on iOS, Android, and Web. Designed for traditional web developers, especially those familiar with React Native or Vue, it simplifies cross‑platform app development.

Used in 27 Tencent apps, reaching billions of users daily.

Features

Supports both React and Vue front‑end frameworks.

Consistent interfaces across platforms.

JS engine binding provides high‑performance front‑end communication.

High‑performance reusable list components.

Smooth migration to web browsers.

Full Flex layout engine support.

Project address

GitHub: https://github.com/Tencent/Hippy

Component‑Based Mini‑Program Development Framework

WePY enables component‑based development for mini‑programs via pre‑compilation, supporting Vue‑like development style, custom components, NPM packages, Promise, async functions, and various compilers and plugins for optimization.

Features

Vue‑like development style.

Custom component development.

Supports NPM package integration.

Promise and async function support.

Supports multiple compilers (Less, Sass, Stylus, PostCSS, Babel, TypeScript, Pug).

Various plugin handling (file compression, image compression, content replacement, etc.).

Sourcemap and ESLint support.

Mini‑program specific optimizations (request queue, event optimization).

Project address

GitHub: https://github.com/Tencent/wepy

IoT Real‑Time Operating System

TencentOS tiny is a real‑time operating system for IoT, featuring low power, low resource usage, modularity, and security. It provides a lightweight RTOS kernel, configurable components, and supports various MCUs (e.g., STM32 series).

It includes rich IoT components and integrates mainstream protocol stacks (CoAP, MQTT, TLS/DTLS, LoRaWAN, NB‑IoT) to quickly connect devices to Tencent Cloud IoT platform.

Architecture Overview

Key layers include CPU libraries (ARM Cortex‑M0/3/4/7, Cortex‑A7, RISC‑V, etc.), driver management (BSP, HAL, device drivers), kernel (task management, scheduling, memory, timers, synchronization, etc.), IoT protocol stack (lwIP, AT Adapter, SAL, CoAP, MQTT), security framework (DTLS/TLS), and component framework (file system, KV storage, mesh networking, JS engine, OTA, debugging tools).

Project address

GitHub: https://github.com/Tencent/TencentOS-tiny

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

cross-platformartificial intelligenceopen sourceframeworksTencent
Architect's Guide
Written by

Architect's Guide

Dedicated to sharing programmer-architect skills—Java backend, system, microservice, and distributed architectures—to help you become a senior architect.

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.