{"id":44199637,"url":"https://github.com/block/francis","last_synced_at":"2026-04-03T19:01:35.638Z","repository":{"id":337489841,"uuid":"1151652733","full_name":"block/francis","owner":"block","description":"A Kotlin-based CLI for A/B performance testing on Android","archived":false,"fork":false,"pushed_at":"2026-03-06T23:44:21.000Z","size":232,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-30T05:26:30.684Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/block.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-02-06T18:23:42.000Z","updated_at":"2026-03-12T20:45:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/block/francis","commit_stats":null,"previous_names":["block/francis"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/block/francis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Ffrancis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Ffrancis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Ffrancis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Ffrancis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/block","download_url":"https://codeload.github.com/block/francis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/block%2Ffrancis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31371636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T17:53:18.093Z","status":"ssl_error","status_checked_at":"2026-04-03T17:53:17.617Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-09T21:18:49.407Z","updated_at":"2026-04-03T19:01:35.629Z","avatar_url":"https://github.com/block.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# francis\n\u003e \"Observation and experiment for gathering material, induction and deduction for elaborating it: these are our only good intellectual tools.\"\n\n*- Francis Bacon (1561-1626), English philosopher and statesman, regarded as the father of empiricism*\n\nA CLI for rigorous A/B performance testing on Android.\n\n## Why Francis?\n\nFrancis wraps\n[Android Macrobenchmark](https://developer.android.com/topic/performance/benchmarking/macrobenchmark-overview),\nproviding a simple CLI that:\n- installs APKs, configures instrumentation args, runs benchmarks, and\n  retrieves results\n- monitors logcat and parses instrumentation output to provide actionable error\n  messages\n\nFrancis also provides commands to\n- run [A/B tests](https://en.wikipedia.org/wiki/A/B_testing) of macrobenchmarks and\n  determine whether differences are statistically meaningful.\n- collect simpleperf/perfetto traces\n\n## Usage\n```sh\n# See list of supported commands:\nfrancis --help\n\n# See detailed docs for a specific command (e.g. bench):\nfrancis bench --help\n\n# Collect macrobenchmark results\nfrancis bench --app app.apk --instrumentation benchmark.apk --test-symbol 'com.example.Example#benchmarkMethod'\n\n# Collect results of an A/B test of a macrobenchmark\nfrancis ab --instrumentation benchmark.apk --test-symbol 'com.example.Example#benchmarkMethod' \\\n  --baseline-opts baseline-version-of-app.apk \\\n  --treatment-opts treatment-version-of-app.apk\n\n# Compare two sets of macrobenchmark results (e.g. result of `ab` command above)\nfrancis compare baseline-results.json treatment-results.json\n\n# Collect a manual perfetto trace (no instrumentation)\nfrancis perfetto\n\n# Collect a manual simpleperf trace (no instrumentation)\nfrancis simpleperf\n\n# Collect a perfetto trace of an instrumentation scenario\nfrancis perfetto --app app.apk --instrumentation benchmark.apk --test-symbol 'com.example.Example#benchmarkMethod'\n\n# Collect a simpleperf trace of an instrumentation scenario\nfrancis simpleperf --app app.apk --instrumentation benchmark.apk --test-symbol 'com.example.Example#benchmarkMethod'\n```\n\n## Installation\n```sh\nbrew install block/tap/francis\n```\n\n## Integrating with the Instrumentation SDK\nBasic benchmark and A/B test usage works without the instrumentation SDK, but some features (modifying iteration count, perfetto/simpleperf trace collection of instrumentation scenarios) require modifying your instrumentation apk. Assuming you created your macrobenchmark in the style of [the official docs](https://developer.android.com/topic/performance/benchmarking/macrobenchmark-overview#create-macrobenchmark), you'll make the following changes:\n\n1. Add a dependency on `com.squareup.francis:instrumentation-sdk`. In your instrumentation apk's `build.gradle` (Groovy syntax):\n```groovy\ndependencies {\n  androidTestImplementation \"com.squareup.francis:instrumentation-sdk\"\n}\n```\n\nor `build.gradle.kts` (Kotlin syntax):\n\n```kotlin\ndependencies {\n  androidTestImplementation(\"com.squareup.francis:instrumentation-sdk\")\n}\n```\n\n2. Replace `MacrobenchmarkRule` with `FrancisBenchmarkRule`:\n\n```diff\n- import androidx.benchmark.macro.junit4.MacrobenchmarkRule\n+ import com.squareup.francis.FrancisBenchmarkRule\n\n...\n\n    @get:Rule\n-   val benchmarkRule = MacrobenchmarkRule()\n+   val benchmarkRule = FrancisBenchmarkRule()\n```\n\nThis allows Francis to hook into [measureRepeated](https://developer.android.com/reference/kotlin/androidx/benchmark/macro/junit4/MacrobenchmarkRule#measureRepeated(kotlin.String,kotlin.collections.List,androidx.benchmark.macro.CompilationMode,androidx.benchmark.macro.StartupMode,kotlin.Int,kotlin.Function1,kotlin.Function1)) invocations and modify arguments to, e.g:\n- change iteration count\n- surround the measureBlock parameter with code to start/stop perfetto/simpleperf in order to capture traces\n\n3. Optionally use `@Disable` (from the instrumentation SDK) instead of `@Ignore`:\n\n```kotlin\nimport com.squareup.francis.Disable\n\n@Disable(\"TRACKER-123\")\n@Test\nfun expensiveBenchmark() {\n  // ...\n}\n```\n\n`@Disable` skips the test by default, but Francis automatically sets `francis.overrideDisable`\nfrom `--symbol`. This way you disable a test in CI, but still run it manually with Francis.\n\nIf `@Disable` is on a class, target that class (`com.example.BenchmarkClass`) to override it.\nIf `@Disable` is on a method, target that method\n(`com.example.BenchmarkClass#expensiveBenchmark`) to override it.\n\n## Development\nYou can use `scripts/francis` to build and run francis during development. If you don't have a specific app/instrumentation that you want to test it with, you can use `scripts/francis-demo` - it's the same as `scripts/francis` but it includes predefined app/instrumentation apks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock%2Ffrancis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblock%2Ffrancis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblock%2Ffrancis/lists"}