Skip to content

feat: Add Hermes engine optimizations for Android performance#523

Open
Codex723 wants to merge 1 commit into
Smartdevs17:mainfrom
Codex723:hermes-android-optimizations
Open

feat: Add Hermes engine optimizations for Android performance#523
Codex723 wants to merge 1 commit into
Smartdevs17:mainfrom
Codex723:hermes-android-optimizations

Conversation

@Codex723
Copy link
Copy Markdown

@Codex723 Codex723 commented Jun 1, 2026

Closes #419

Summary

Implement comprehensive Hermes engine optimizations to improve Android performance, targeting:

  • Startup time reduction (<2s target)
  • Frame rate improvement (60fps on mid-range devices)
  • Memory usage optimization

Changes

Configuration Updates

  • metro.config.js: Enabled Hermes transformer, production minification with console removal, and @shopify/metro-serializer-hermes for bytecode serialization
  • babel.config.js: Added babel-plugin-module-resolver and babel-plugin-transform-remove-console for optimized builds
  • app.json: Added jsEngine: hermes and optimization flags (--inline-store-on-put, --allocation-profile)
  • app.config.js: Extended with runtime Hermes configuration and added hermesOptimizations to extra config
  • package.json: Added @shopify/metro-serializer-hermes dependency for bytecode serialization
  • performance-budget.json: Extended with Android-specific startup time (2000ms) and FPS (60fps) targets

New Utility Modules

  • src/utils/hermesOptimizer.ts: Identifies critical modules (store, i18n, navigation, session) for pre-compilation
  • src/utils/startupTimeOptimizer.ts: Measures Android startup time with AppState tracking

Tests

  • src/utils/tests/hermesOptimizer.test.ts: Unit tests for Hermes optimizer
  • src/utils/tests/startupTimeOptimizer.test.ts: Unit tests for startup measurement

Acceptance Criteria

  • Hermes engine configuration tuning
  • Pre-compiled bytecode for critical modules
  • Android startup time reduction (target: <2s)
  • Frame rate improvement (60fps on mid-range devices)
  • Memory usage optimization

Testing

Run npm run performance:ci to validate performance budget.

- Configure Hermes engine in metro.config.js with custom serializer
- Add Hermes flags to app.json for inline-store-on-put and allocation-profile
- Add babel-plugin-module-resolver and transform-remove-console for bundle optimization
- Create startupTimeOptimizer.ts for measuring Android startup time
- Create hermesOptimizer.ts for critical module precompilation tracking
- Update performance-budget.json with Android startup and FPS targets
- Add unit tests for optimization utilities
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@Codex723 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17
Copy link
Copy Markdown
Owner

⚠️ Merge failed — check CI status.

🤖 Drips Wave Merge Agent

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.

Add Hermes engine optimizations for Android performance

2 participants