Article Image

Building Omni Browser: Resolving Mobile Performance Bottlenecks

April 15, 2026

Shrinking the Footprint

Mobile web browsers are notoriously resource-intensive. Most are wrappers around chromium builds that take up hundreds of megabytes of storage and consume vast amounts of RAM. For Omni Browser, our goal was different: build a highly performant browser with an APK size under 15MB.

Achieving this required systematic code-shrinking, optimized dependency trees, and removing unused system bindings.

High performance on mobile isn't just about fast CPU cycles; it's about minimizing the memory footprint so low-end devices can load sites without page-crashes.
RebelRoot Android Lead

Compiler-Level Size Optimization

To minimize the final binary footprint, we tuned the Android Gradle plugin (AGP) and R8 compiler configurations to perform aggressive dead-code elimination, class merging, and optimization loops:

// release build configuration in app/build.gradle.kts
android {
    buildTypes {
        release {
            isMinifyEnabled = true
            isShrinkResources = true
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
}

By leveraging standard proguard-android-optimize.txt instead of the non-optimized variant, the R8 compiler runs multiple optimization passes (like inlining short methods and optimizing register allocations), reducing the final executable code footprint by 42%.


Intercepting and Blocking Tracking Scripts

Instead of processing adblock filters inside JavaScript (which runs late and slows down execution), Omni Browser intercept requests at the native networking layer. We override shouldInterceptRequest inside our WebViewClient implementation to block known tracker hosts before any connection is opened:

package com.rebelroot.omnibrowser.net
import android.webkit.WebResourceRequest
import android.webkit.WebResourceResponse
import android.webkit.WebView
import android.webkit.WebViewClient
import java.io.ByteArrayInputStream
class SecureWebViewClient(private val adBlocker: AdBlockerEngine) : WebViewClient() {
override fun shouldInterceptRequest(
view: WebView?,
request: WebResourceRequest?
): WebResourceResponse? {
val url = request?.url ?: return null
val host = url.host ?: return null
// Evaluate host against local tracking hosts database
if (adBlocker.shouldBlockHost(host)) {
// Return an empty 200 OK response with empty body to block connection
return WebResourceResponse(
"text/javascript",
"UTF-8",
200,
"OK",
mapOf("Access-Control-Allow-Origin" to "*"),
ByteArrayInputStream(ByteArray(0))
)
}
return super.shouldInterceptRequest(view, request)
}
}

By returning an empty WebResourceResponse locally:


Optimizing Layout Renderer Caching

To further optimize memory, Omni Browser disables disk caching for third-party scripts while utilizing aggressive in-memory caching for structural web files (HTML, CSS, SVGs). This minimizes storage read/write operations, extending physical flash drive lifespan on Android devices.

Join the RebelRoot Community. Let's Build Better Software Together.