Macro Inc Performance Benchmarks: What the Source Code Reveals

Macro Inc does not publish a consolidated public benchmark suite; instead, performance metrics and optimization strategies are embedded in service-specific documentation and code comments across the Rust-based workspace.

This article examines the actual performance-related artifacts found in the macro-inc/macro repository. While you won't find a single "docs/benchmarks.md" file, the codebase contains concrete timing data, optimization patterns, and measurement methodologies that reveal how the engineering team evaluates system performance.

Where Performance Data Lives in the Macro Inc Codebase

The repository follows a distributed approach to performance documentation. Rather than centralizing benchmarks, each service or library maintains its own performance notes where they're most relevant to developers.

Client-Side IPC: The Skipped Tauri Benchmark

In apps/web/docs/graphql-normalized-cache-plan.md, the team documents a deliberate decision to skip a planned Tauri IPC benchmark. The conclusion: the IPC path was deemed "adequate for current needs" without requiring formal measurement.

This is significant for two reasons:

  • It demonstrates pragmatic performance evaluation — not every path needs benchmarking
  • The documentation of the decision preserves context for future optimization work

Email Service: Concrete Throughput Numbers

The services/email_service/src/bin/find_used_sfs_ids/README.md and sibling README files contain the most specific performance data in the repository. These documents cover:

  • Typical throughput for bulk delete operations
  • Concurrency level effects on processing time

For example, the email service's bulk S3 deletion handler includes operational notes on how parallelization impacts total job duration. These aren't synthetic benchmarks — they're observed production timings that guide capacity planning.

Loro-Mirror CRDT Library: Optimization Patterns

The packages/loro-mirror/REFERENCE.md file addresses performance for the CRDT (Conflict-free Replicated Data Type) layer. A specific performance tip for large lists recommends using an idSelector parameter, which can significantly reduce memory pressure and operation latency when handling extensive document histories.

This pattern illustrates Macro Inc's performance philosophy: document the optimization technique alongside the API that enables it.

Style Guide: Performance Testing as First-Class Practice

docs/STYLE_GUIDE.md explicitly mentions performance tests as part of the standard test suite, alongside functional and integration tests. This indicates:

  • Automated performance regression detection in CI
  • Established patterns for writing measurable performance assertions
  • Cultural prioritization of performance maintainability

Database Layer: Index-Driven Optimizations

Migration notes in CLAUDE.md and related files frequently cite "Updated all indexes for performance" when describing schema changes. These inline comments serve as historical performance audit trails, showing which table modifications were motivated by observed query latency rather than functional requirements.

How Macro Inc Measures Performance: The Embedded Pattern

Across the codebase, a consistent three-step approach emerges for performance evaluation:

  1. Identify critical paths — IPC boundaries, bulk operations, CRDT mutations
  2. Add targeted measurements — README notes, inline timing, production logging
  3. Iterate with visible optimizations — index changes, query redesign, selector APIs

This differs from benchmark-driven development in that measurements are tied to specific operational concerns rather than published as marketing metrics.

Instrumenting Your Own Macro Inc Performance Tests

Since no unified benchmark harness exists, you'll need to add instrumentation to specific services. Below are two patterns derived from the repository's architecture.

Measuring Axum Endpoint Latency in Rust

// services/your_service/src/handlers/metrics.rs
use axum::{extract::State, Json};
use std::time::Instant;
use serde_json::{json, Value};

pub async fn instrumented_operation(
    State(state): State<AppState>
) -> Json<Value> {
    let start = Instant::now();

    // Your operation here
    let result = state.repository.expensive_query().await;

    let elapsed_ms = start.elapsed().as_millis();
    
    tracing::info!(
        operation = "expensive_query",
        latency_ms = elapsed_ms,
        "performance measurement"
    );

    Json(json!({
        "result": result,
        "latency_ms": elapsed_ms
    }))
}

This pattern matches the observability approach seen in email service binaries, where timing data feeds into operational logs rather than benchmark reports.

Benchmarking Bulk S3 Operations in Node.js

// scripts/benchmark-s3-delete.js
import { S3Client, DeleteObjectsCommand } from "@aws-sdk/client-s3";
import { performance } from "perf_hooks";

const client = new S3Client({ region: process.env.AWS_REGION });

async function benchmarkBulkDelete(bucket, keyCount, batchSize) {
  const keys = Array.from(
    { length: keyCount }, 
    (_, i) => `benchmark/file-${i}.txt`
  );
  
  const results = [];

  for (let i = 0; i < keys.length; i += batchSize) {
    const batch = keys.slice(i, i + batchSize);
    const start = performance.now();
    
    await client.send(
      new DeleteObjectsCommand({
        Bucket: bucket,
        Delete: { Objects: batch.map(k => ({ Key: k })) },
      })
    );
    
    const elapsed = performance.now() - start;
    results.push({
      batch_index: i / batchSize,
      objects_deleted: batch.length,
      duration_ms: elapsed.toFixed(2)
    });
  }

  const totalMs = results.reduce((sum, r) => sum + parseFloat(r.duration_ms), 0);
  console.table(results);
  console.log(`Total: ${keyCount} objects in ${totalMs.toFixed(2)}ms`);
  console.log(`Average: ${(totalMs / results.length).toFixed(2)}ms/batch`);
}

benchmarkBulkDelete("your-bucket", 1000, 50);

This extends the measurement pattern found in services/email_service to generate reproducible benchmark data for your specific deployment configuration.

Key Performance Files in macro-inc/macro

File Path Performance Insight
apps/web/docs/graphql-normalized-cache-plan.md Tauri IPC benchmark decision documentation
services/email_service/src/bin/find_used_sfs_ids/README.md Concrete bulk operation timings
packages/loro-mirror/REFERENCE.md CRDT list optimization techniques
docs/STYLE_GUIDE.md Performance testing methodology
CLAUDE.md Historical index optimization decisions
services/*/src/bin/*/README.md Service-specific throughput notes

Summary

  • Macro Inc performance benchmarks are decentralized — no single report exists, but granular data lives in service documentation
  • Email service READMEs contain the most specific timing data, particularly for bulk S3 and database operations
  • Optimization patterns are documented alongside APIs, as seen in loro-mirror's idSelector guidance
  • Performance testing is standardized via the style guide, with automated checks in the test suite
  • Database performance is addressed through index management, with migration notes serving as audit trails

Frequently Asked Questions

Does Macro Inc publish official benchmark results?

No. The repository does not contain a consolidated benchmark report with synthetic metrics like "documents processed per second." Instead, the engineering team documents observed performance characteristics in service-specific README files and optimization notes within source code.

Where can I find concrete performance numbers for Macro Inc services?

The services/email_service/src/bin/ directory contains the most specific data. Each binary's README includes typical throughput figures and concurrency behavior for operations like bulk S3 deletion and ID resolution. These reflect production observations rather than lab benchmarks.

How does Macro Inc prevent performance regressions?

According to docs/STYLE_GUIDE.md, performance tests are integrated into the standard test suite alongside functional and integration tests. This enables automated detection of latency increases or throughput degradation during continuous integration.

What optimization techniques does Macro Inc use for large-scale data?

The packages/loro-mirror/REFERENCE.md file documents CRDT-specific optimizations, particularly the idSelector pattern for large list operations. Additionally, migration history in CLAUDE.md shows database index updates as the primary lever for query performance improvements.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →