|
1 | | -# Task Optimizer – Magisk Module |
2 | | - |
3 | | -**Boost system responsiveness, improve gaming performance, and smooth out UI interactions — automatically.** |
4 | | -Task Optimizer intelligently adjusts CPU affinity, priority, and I/O scheduling for critical Android system processes. |
| 1 | +# Core Task Optimizer: Native C++ Android Performance Module |
5 | 2 |
|
6 | 3 | [](https://github.com/c0d3h01/CoreTaskOptimizer/actions/workflows/checks.yml) |
7 | 4 |
|
8 | | ---- |
9 | | - |
10 | | -## Features |
| 5 | +**A high-performance Magisk module written in C++17 that optimizes Android system processes via direct Linux syscalls.** |
11 | 6 |
|
12 | | -* **High-priority tuning** for essential Android services (`system_server`, `zygote`, `surfaceflinger`, etc.) |
13 | | -* **Real-time performance boost** for graphics and touch input threads |
14 | | -* **Background process throttling** to free up resources for active tasks |
15 | | -* **Launcher optimization** for smoother home screen animations |
16 | | -* **Touch & display IRQ tuning** for faster input response |
17 | | -* **Automatic logging** for transparency and troubleshooting |
| 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. |
18 | 8 |
|
19 | 9 | --- |
20 | 10 |
|
21 | | -## Installation |
| 11 | +## ⚡ Core Features |
22 | 12 |
|
23 | | -1. Download the latest release ZIP. |
24 | | -2. Open **Magisk Manager**. |
25 | | -3. Tap **Modules** → **Install from storage**. |
26 | | -4. Select the downloaded ZIP and install. |
27 | | -5. Reboot your device. |
| 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. |
28 | 18 |
|
29 | 19 | --- |
30 | 20 |
|
31 | | -## How It Works |
| 21 | +## 🛠️ Technical Implementation |
32 | 22 |
|
33 | | -* Detects running processes and threads using `/proc` |
34 | | -* Matches them against a curated list of **high**, **real-time**, and **low priority** patterns |
35 | | -* Applies: |
| 23 | +The optimizer uses a custom `SyscallOptimizer` class to apply changes safely and effectively: |
36 | 24 |
|
37 | | - * **CPU affinity masks** (performance vs. efficiency cores) |
38 | | - * **Nice values** (process scheduling priority) |
39 | | - * **Real-time scheduling** for critical rendering/touch threads |
40 | | - * **I/O scheduling classes** for background tasks |
41 | | -* Logs all actions to: |
| 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. |
42 | 29 |
|
43 | | - * `/data/adb/modules/task_optimizer/logs/main.log` |
44 | | - * `/data/adb/modules/task_optimizer/logs/error.log` |
| 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 | + |
| 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. |
45 | 39 |
|
46 | 40 | --- |
47 | 41 |
|
48 | | -## Requirements |
| 42 | +## 📊 Logging & Transparency |
| 43 | + |
| 44 | +The module includes a thread-safe `Logger` with automatic rotation to ensure transparency without filling your storage. |
49 | 45 |
|
50 | | -* Root access via **Magisk** |
51 | | -* Android 8.0+ recommended |
52 | | -* BusyBox - No need (Magisk has its inbuilt) |
| 46 | +* **Main Log:** `/data/adb/modules/task_optimizer/logs/main.log` |
| 47 | +* **Error Log:** `/data/adb/modules/task_optimizer/logs/error.log` |
53 | 48 |
|
54 | 49 | --- |
55 | 50 |
|
56 | | -> [!CAUTION] |
57 | | -> I am not responsible for any kind damage of software or hardware |
58 | | -> Use at your own risk! |
| 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). |
59 | 56 |
|
60 | 57 | --- |
61 | 58 |
|
62 | | -> [!NOTE] |
63 | | -> All changes are **temporary** — they reset after reboot unless the module runs again. |
64 | | -> Safe to uninstall from Magisk at any time. |
65 | | -> May have no effect on heavily customized vendor kernels that override CPU settings. |
| 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. |
66 | 65 |
|
67 | 66 | --- |
68 | 67 |
|
69 | | -## License |
| 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. |
| 73 | +
|
| 74 | +--- |
70 | 75 |
|
71 | | -**This project is licensed under the** [MIT License](LICENSE) |
| 76 | +**Keywords:** *C++ Android Optimizer, Magisk Module, SCHED_FIFO, CPU Affinity, Linux Syscall, Kgsl GPU Boost, Touch Latency Fix, Surfaceflinger Optimization, Root Performance.* |
0 commit comments