Skip to content

perf(injector): Optimize performance with fast parsers and direct syscalls#134

Open
HSSkyBoy wants to merge 3 commits intoJingMatrix:masterfrom
HSSkyBoy:patch-4
Open

perf(injector): Optimize performance with fast parsers and direct syscalls#134
HSSkyBoy wants to merge 3 commits intoJingMatrix:masterfrom
HSSkyBoy:patch-4

Conversation

@HSSkyBoy
Copy link
Copy Markdown

Optimize the injector module by replacing sscanf with custom fast parsers for device format and integer parsing, using string_view for zero-copy prefix checks, and employing direct getdents64 syscalls for FD traversal to reduce overhead.Refactor prop loading with low-level I/O instead of ifstream, add early exit in map scanning, fix logic errors and FD leaks in urandom hex generation.

Co-Authored-By: Max 109047395+maxsteeel@users.noreply.github.com

JingMatrix and others added 3 commits April 12, 2026 16:54
We implement a connection check to bypass process flag retrieval and module execution for isolated processes when the zygisk daemon is unreachable.
…calls

Replaced sscanf with a custom fast parser for device format and improved string prefix checking using string_view.
Replace ifstream with low-level I/O for spoof.prop.
Use string_view for zero-copy line parsing.
Fix logic errors and FD leaks in urandom hex generation.
Early exit in map scanning once target library is found.

Co-Authored-By: Max <109047395+maxsteeel@users.noreply.github.com>
@JingMatrix
Copy link
Copy Markdown
Owner

I prefer to have as less code as possible, optimization is barely needed for most of cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants