|
1 | | -# Core Task Optimizer: Native C++ Android Performance Module |
| 1 | +# Core Task Optimizer |
2 | 2 |
|
3 | 3 | [](https://github.com/c0d3h01/CoreTaskOptimizer/actions/workflows/checks.yml) |
| 4 | +[](LICENSE) |
4 | 5 |
|
5 | | -**A high-performance Magisk module written in C++17 that optimizes Android system processes via direct Linux syscalls.** |
| 6 | +Core Task Optimizer is a native C++ Android root module built for Magisk, KernelSU, and APatch. It improves system responsiveness by applying low level CPU affinity, scheduler, and I/O priority policies to critical system tasks using direct Linux syscalls. |
6 | 7 |
|
7 | | -Unlike shell-based optimizers, **Core Task Optimizer** runs as a native binary, offering nanosecond-level efficiency in adjusting CPU affinity, scheduling policies (`SCHED_FIFO`), and I/O priorities to eliminate UI lag and reduce touch latency. |
| 8 | +## Why This Module |
8 | 9 |
|
9 | | ---- |
| 10 | +- Focused on system level latency and UI smoothness |
| 11 | +- Uses native C++ syscalls instead of shell wrappers |
| 12 | +- Applies policies at the thread level for precision |
| 13 | +- One shot run at boot for minimal overhead |
10 | 14 |
|
11 | | -## ⚡ Core Features |
| 15 | +## How It Works |
12 | 16 |
|
13 | | -* **🚀 Native C++ Architecture:** Built with C++17 for minimal overhead and thread-safe execution. |
14 | | -* **🧠 Auto-Adaptive CPU Topology:** Dynamically detects Performance vs. Efficiency cores by parsing `/sys/devices/system/cpu` frequencies. No hardcoded core masks. |
15 | | -* **🎮 GPU & Touch Real-Time Mode:** Forces `SCHED_FIFO` priority on critical threads like `kgsl_worker_thread` (Adreno GPU) and `fts_wq` (Touch Panels). |
16 | | -* **🛡️ Syscall-Level Optimization:** Bypasses standard shell commands to invoke `sched_setaffinity`, `setpriority`, and `ioprio_set` directly via the kernel interface. |
17 | | -* **🔋 Intelligent I/O Throttling:** automatically lowers I/O priority for background logging and garbage collection tasks (`f2fs_gc`) to prevent disk contention. |
| 17 | +- Matches selected process names from `/proc/<pid>/comm` |
| 18 | +- Applies policies to every thread in `/proc/<pid>/task` |
| 19 | +- Groups include system critical, real time, and background maintenance |
| 20 | +- Logs all actions to `/data/adb/modules/task_optimizer/logs/` |
18 | 21 |
|
19 | | ---- |
| 22 | +## Compatibility |
20 | 23 |
|
21 | | -## 🛠️ Technical Implementation |
| 24 | +- Root required: Magisk, KernelSU, or APatch |
| 25 | +- Android 8.0+ recommended |
| 26 | +- ARM64 preferred (other ABIs supported if built) |
22 | 27 |
|
23 | | -The optimizer uses a custom `SyscallOptimizer` class to apply changes safely and effectively: |
| 28 | +## Quick Start |
24 | 29 |
|
25 | | -### 1. High Priority System Tasks |
26 | | -**Target:** `system_server`, `surfaceflinger`, `zygote`, `composer` |
27 | | -* **Action:** Sets **Nice -10** and locks to **Performance Cores**. |
28 | | -* **Result:** Instant app launches and smoother UI rendering. |
| 30 | +- Install the module zip from Releases |
| 31 | +- Reboot and wait for boot completion plus 30 seconds |
| 32 | +- Open `/data/adb/modules/task_optimizer/logs/main.log` |
29 | 33 |
|
30 | | -### 2. Real-Time (RT) Latency Reduction |
31 | | -**Target:** `kgsl_worker_thread` (GPU), `crtc_commit` (Display), `nvt_ts_work` (Touch Input) |
32 | | -* **Action:** Applies **SCHED_FIFO** (Real-Time Scheduling) with Priority 50. |
33 | | -* **Result:** Eliminates micro-stutters in games and reduces input delay. |
| 34 | +## Documentation |
34 | 35 |
|
35 | | -### 3. Background Suppression |
36 | | -**Target:** `f2fs_gc`, `wlan_logging_th` |
37 | | -* **Action:** Sets **Nice 5**, restricts to **Efficiency Cores**, and lowers **I/O Class to 3**. |
38 | | -* **Result:** Prevents background maintenance from slowing down your active app. |
| 36 | +This README is the index for the full wiki. Start with Home or Overview. |
39 | 37 |
|
40 | | ---- |
| 38 | +- [Home](../../wiki/Home) |
| 39 | +- [Overview](../../wiki/Overview) |
| 40 | +- [Installation](../../wiki/Installation) |
| 41 | +- [Usage](../../wiki/Usage) |
| 42 | +- [How It Works](../../wiki/How-It-Works) |
| 43 | +- [Optimization Targets](../../wiki/Optimization-Targets) |
| 44 | +- [Logging and Diagnostics](../../wiki/Logging-and-Diagnostics) |
| 45 | +- [Troubleshooting](../../wiki/Troubleshooting) |
| 46 | +- [Advanced Tuning](../../wiki/Advanced-Tuning) |
| 47 | +- [Build and Development](../../wiki/Build-and-Development) |
| 48 | +- [FAQ](../../wiki/FAQ) |
| 49 | +- [Changelog](../../wiki/Changelog) |
41 | 50 |
|
42 | | -## 📊 Logging & Transparency |
| 51 | +## Safety Notice |
43 | 52 |
|
44 | | -The module includes a thread-safe `Logger` with automatic rotation to ensure transparency without filling your storage. |
45 | | - |
46 | | -* **Main Log:** `/data/adb/modules/task_optimizer/logs/main.log` |
47 | | -* **Error Log:** `/data/adb/modules/task_optimizer/logs/error.log` |
48 | | - |
49 | | ---- |
50 | | - |
51 | | -## 📋 Requirements |
52 | | - |
53 | | -* **Root Access:** Magisk, KernelSU, or APatch. |
54 | | -* **Android Version:** Android 8.0+ (Oreo and newer). |
55 | | -* **Architecture:** ARM64 (Snapdragon, MediaTek, Exynos, Tensor). |
56 | | - |
57 | | ---- |
58 | | - |
59 | | -## 📥 Installation |
60 | | - |
61 | | -1. Download the latest ZIP from [Releases](#). |
62 | | -2. Install via Magisk/KernelSU Manager. |
63 | | -3. Reboot. |
64 | | -4. Check the logs at the path above to verify successful optimizations. |
65 | | - |
66 | | ---- |
67 | | - |
68 | | -> [!NOTE] |
69 | | -> **Safety First:** This module uses a `Sanitizer` class to validate PIDs and prevent regex injection. It is designed to be fail-safe; if a syscall fails, it logs the error and continues without crashing the system. |
70 | | -
|
71 | | -> [!CAUTION] |
72 | | -> **Disclaimer:** While thoroughly tested, modifying kernel scheduling parameters always carries a slight risk. I am not responsible for any software instability. |
| 53 | +This module changes kernel scheduling behavior. Read the Safety and Limits page before using it on production devices. |
0 commit comments