Explore Tencent’s Open‑Source Tools: KV Stores, AI, Mobile & More
This article introduces a collection of high‑performance open‑source components from Tencent—including a key‑value store, API framework, networking library, AI inference engine, Android hot‑patch system, coroutine library, plugin framework, cross‑platform UI framework, mini‑program tool, and an IoT real‑time OS—detailing their core principles, features, and GitHub links.
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 stability, used in WeChat since 2015, and has been ported to Android, macOS, Win32, POSIX and open‑sourced.
MMKV Principles
Memory Preparation : Uses mmap to map a file into memory, providing a writable memory block that the OS writes back to the file, ensuring data persistence even after crashes.
Data Organization : Uses protobuf for serialization, offering good performance and space efficiency.
Write Optimization : Supports incremental updates by appending serialized kv objects to the memory end.
Space Growth : Addresses uncontrolled file size growth from appends by balancing performance and space.
Project address: https://github.com/Tencent/MMKV
APIJSON
APIJSON is a JSON‑based network transmission protocol and ORM library designed for APIs. It provides fully automated universal APIs for CRUD, complex queries, and simple transactions, reducing development and communication costs, suitable for small‑to‑medium front‑back separation projects, BaaS, Serverless, and enterprise use.
For Frontend
No need to chase backend interfaces or request documentation.
Data and structure are fully customizable.
Results are visible from requests, what you ask for is what you get.
One request can retrieve any data in any structure.
Eliminates duplicate data, saving bandwidth and improving speed.
For Backend
Provides generic interfaces, reducing the need to write most APIs.
Automatically generates documentation.
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: https://github.com/Tencent/APIJSON
Mars – Cross‑Platform, Cross‑Business Terminal Foundation Component
Mars is a cross‑platform, cross‑business terminal foundation component used by WeChat. It includes:
comm : Public library with socket, thread, message queue, coroutine, etc.
xlog : High‑reliability, high‑performance runtime logging component.
SDT : Network diagnostic component.
STN : Signalling distribution network module, the core of Mars.
Project address: https://github.com/Tencent/Mars
ncnn – High‑Performance Neural Network Forward‑Computation Framework
ncnn is a mobile‑optimized high‑performance neural network forward‑computation framework. It has no third‑party dependencies, is cross‑platform, and its CPU speed on mobile devices surpasses known open‑source frameworks. Used in many Tencent apps such as QQ, Qzone, WeChat, and MeituPic.
Features
Supports CNNs, multiple inputs, multi‑branch structures, and partial branch computation.
No third‑party library dependencies (no BLAS/NNPACK).
Pure C++ implementation, cross‑platform (Android, iOS, etc.).
ARM NEON assembly‑level optimizations for fast computation.
Fine‑grained memory management and data structures for low memory usage.
Multi‑core parallel acceleration with ARM big.LITTLE scheduling optimizations.
Vulkan API GPU acceleration with low consumption.
Library size under 700 KB, can be trimmed below 300 KB.
Project address: https://github.com/Tencent/ncnn
Tinker – Android Hot‑Patch Solution
Tinker is WeChat’s Android hot‑patch solution that supports dynamic delivery of code, .so libraries, and resources, enabling updates without reinstalling the app. It includes:
Gradle plugin: tinker-patch-gradle-plugin
Core SDK library: tinker-android-lib
CLI version for non‑Gradle users: tinker-patch-cli.jar
Project address: https://github.com/Tencent/tinker
libco – C/C++ Coroutine Library
libco is a C/C++ coroutine library used at massive scale in WeChat backend since 2013. It provides simple interfaces (co_create, co_resume, co_yield, co_poll) and socket hooks, allowing asynchronous conversion of thread services with minimal code changes.
Features
No intrusion into business logic; transforms multi‑process/thread services to coroutine services with hundred‑fold concurrency boost.
Supports CGI framework for easy web service construction.
Supports common third‑party libraries such as gethostbyname, mysqlclient, ssl.
Optional shared‑stack mode for millions of connections.
Simple pthread‑like API for coroutine creation and resumption.
Thread‑local coroutine variables and semaphore (co_signal).
Lambda‑style language support for inline asynchronous tasks.
Lightweight network framework based on epoll/kqueue and high‑performance timer wheel.
Project address: https://github.com/Tencent/libco
Shadow – Android Plugin Framework
Shadow is a Tencent‑developed Android plugin framework validated by billions of users. It offers source reuse, zero‑reflection, zero‑Hack implementation, fully dynamic architecture, minimal host footprint (~15 KB, ~160 methods), and core code written in Kotlin.
Project address: https://github.com/Tencent/Shadow
Hippy – Cross‑Platform Development Framework
Hippy enables developers to write a single codebase that runs on iOS, Android, and Web. Designed for traditional web developers, especially those familiar with React Native or Vue, it powers 27 Tencent apps, delivering billions of daily users.
Features
Supports React and Vue front‑end frameworks.
Consistent interfaces across platforms.
JS‑engine binding for high‑performance front‑end communication.
High‑performance reusable list components.
Smooth migration to web browsers.
Full Flex layout engine support.
Project address: https://github.com/Tencent/Hippy
WePY – Component‑Based Mini‑Program Framework
WePY enables component‑based development for mini‑programs via pre‑compilation, supporting Vue‑like syntax, custom components, NPM packages, Promise, async functions, and various preprocessors (Less, Sass, Stylus, PostCSS, Babel, TypeScript, Pug). It also offers source‑map, ESLint, and other tooling.
Project address: https://github.com/Tencent/wepy
TencentOS tiny – Real‑Time OS for IoT
TencentOS tiny is a real‑time operating system for IoT devices, featuring low power consumption, small footprint, modularity, and security. It provides a configurable kernel, drivers, IoT protocol stacks (CoAP, MQTT, TLS/DTLS, LoRaWAN, NB‑IoT), security framework (DTLS/TLS), and components such as file system, KV storage, OTA, and debugging tools.
Architecture
CPU Library : Supports ARM Cortex‑M0/3/4/7, Cortex‑A7, RISC‑V, MSP430, AVR, STM8, etc.
Driver Management Layer : Includes BSP, HAL, and device drivers (Wi‑Fi, GPRS, LoRa, etc.).
Kernel : Provides task management, real‑time scheduling, timers, interrupts, memory management, exceptions, software timers, linked lists, message queues, semaphores, mutexes, event flags.
IoT Protocol Stack : Offers lwIP, AT Adapter, SAL, and protocols like CoAP and MQTT.
Security Framework : Implements DTLS/TLS for secure transmission and key authentication for constrained devices.
Component Framework : Includes file system, KV storage, mesh networking, JS engine, low‑power framework, OTA, debugging tools, etc.
Project address: https://github.com/Tencent/TencentOS-tiny
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java High-Performance Architecture
Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
