<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/anvil-move-fast-and-break-things-rbpax12di" -->

---
title: Anvil: move fast and break things | daily.dev
description: The author of Anvil, an Android view-building library, explains a complete architectural rewrite that will require existing users to modify their code. The...
canonical: https://daily.dev/posts/anvil-move-fast-and-break-things-rbpax12di
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Anvil: move fast and break things | daily.dev
og:description: The author of Anvil, an Android view-building library, explains a complete architectural rewrite that will require existing users to modify their code. The...
og:url: https://daily.dev/posts/anvil-move-fast-and-break-things-rbpax12di
og:image: https://api.daily.dev/og/posts/rBpaX12Di.png
og:image:alt: Anvil: move fast and break things
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Anvil: move fast and break things

**[zserge's blog](https://daily.dev/sources/zserge)** · 7 min read · 0 upvotes · 0 comments

## Summary

The author of Anvil, an Android view-building library, explains a complete architectural rewrite that will require existing users to modify their code. The current version builds a virtual layout tree and diffs it against a previous tree (React-style), but this approach is slow due to heavy object allocation and GC pauses (~200us per render of 15 views). The new version, developed on the 'forge' branch, abandons virtual-DOM diffing in favor of a lazy imperative pipeline that manipulates real views directly, reusing previous nodes when values haven't changed. This boosts rendering performance 5-7x, dropping average render time to ~30us. The rewrite shifts from a functional style to an imperative one, introduces new syntax markers (like the 'o' function) to disambiguate view nesting, adds first-class Kotlin support, and splits core, attributes/views, and tests into separate modules. The author shares a roadmap and asks for community help.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://zserge.com/posts/anvil-breaking-changes>

## Questions this post answers

### Why is Anvil moving away from virtual layout diffing like React uses?

Virtual layout diffing was found to be slow on Android because each render cycle allocates and quickly discards lists of child nodes and attributes, causing GC pauses. A simple 15-view layout took about 200 microseconds to render, and rendering time grew linearly with layout complexity, risking missed 60 FPS frames. Rewriting the library was intended to fix this bottleneck.

_Developers weighing UI rendering architectures can track library migrations like this one on daily.dev._

### How much faster is the rewritten Anvil rendering pipeline compared to the old virtual-DOM diffing approach?

The rewritten pipeline is 5 to 7 times faster than the previous virtual layout diffing approach. Average rendering cycles dropped from about 200 microseconds to roughly 30 microseconds, and even huge but mostly constant layouts render in around 30-50 microseconds because unchanged views are skipped rather than rebuilt.

_Anyone benchmarking rendering strategies for Android UI libraries can follow performance-focused rewrites on daily.dev._

### Will upgrading to the new Anvil version require rewriting existing view code?

Yes, the rewrite is a breaking change to Anvil's API. The view() method now returns void instead of a virtual layout tree, view construction switches from a functional to an imperative style, and a new end-of-view marker function (named 'o' or 'x') is required to disambiguate nested view groups, since Java's left-to-right argument evaluation alone cannot reconstruct the tree.

_Developers planning a migration off an older Anvil API can keep tabs on breaking changes via daily.dev._

## Similar posts on daily.dev

- [One Tap, Three Machines: How Android Views, Flutter, and Compose Actually Render Your UI](https://daily.dev/posts/one-tap-three-machines-how-android-views-flutter-and-compose-actually-render-your-ui-2qgm1oxlz) · Medium · 0 upvotes · 0 comments
- [On Rendering Diffs](https://daily.dev/posts/on-rendering-diffs-dohsqatey) · Lobsters · 23 upvotes · 2 comments
- [React and Vue Are Turning Into the Same Framework](https://daily.dev/posts/react-and-vue-are-turning-into-the-same-framework-gdlameyal) · DEV · 22 upvotes · 2 comments
- [Angular vs. React vs. Vue.js: A performance guide for 2026](https://daily.dev/posts/angular-vs-react-vs-vue-js-a-performance-guide-for-2026-njg0otzub) · LogRocket · 43 upvotes · 5 comments
- [The uphill climb of making diff lines performant](https://daily.dev/posts/the-uphill-climb-of-making-diff-lines-performant-dmkgp6vib) · GitHub Blog · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#java](https://daily.dev/tags/java), [#android](https://daily.dev/tags/android), [#kotlin](https://daily.dev/tags/kotlin)

[View this post on daily.dev](https://daily.dev/posts/anvil-move-fast-and-break-things-rbpax12di)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Anvil: move fast and break things","url":"https://daily.dev/posts/anvil-move-fast-and-break-things-rbpax12di","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/anvil-move-fast-and-break-things-rbpax12di"},"datePublished":"2026-08-23T10:20:13.481Z","dateModified":"2026-08-23T10:20:43.633Z","description":"The author of Anvil, an Android view-building library, explains a complete architectural rewrite that will require existing users to modify their code. The...","image":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","thumbnailUrl":"https://media.daily.dev/image/upload/s--VDukGCjf--/f_auto/v1722860399/public/Placeholder%2002","isAccessibleForFree":true,"articleSection":"zserge's blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"zserge's blog","logo":"https://media.daily.dev/image/upload/s--KQnFBOIT--/f_auto,q_auto/v1787480407/logos/zserge","url":"https://daily.dev/sources/zserge"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/anvil-move-fast-and-break-things-rbpax12di","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,java,android,kotlin","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"zserge's blog","item":"https://daily.dev/sources/zserge"},{"@type":"ListItem","position":3,"name":"Anvil: move fast and break things"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/anvil-move-fast-and-break-things-rbpax12di#faq","mainEntity":[{"@type":"Question","name":"Why is Anvil moving away from virtual layout diffing like React uses?","acceptedAnswer":{"@type":"Answer","text":"Virtual layout diffing was found to be slow on Android because each render cycle allocates and quickly discards lists of child nodes and attributes, causing GC pauses. A simple 15-view layout took about 200 microseconds to render, and rendering time grew linearly with layout complexity, risking missed 60 FPS frames. Rewriting the library was intended to fix this bottleneck. Developers weighing UI rendering architectures can track library migrations like this one on daily.dev."}},{"@type":"Question","name":"How much faster is the rewritten Anvil rendering pipeline compared to the old virtual-DOM diffing approach?","acceptedAnswer":{"@type":"Answer","text":"The rewritten pipeline is 5 to 7 times faster than the previous virtual layout diffing approach. Average rendering cycles dropped from about 200 microseconds to roughly 30 microseconds, and even huge but mostly constant layouts render in around 30-50 microseconds because unchanged views are skipped rather than rebuilt. Anyone benchmarking rendering strategies for Android UI libraries can follow performance-focused rewrites on daily.dev."}},{"@type":"Question","name":"Will upgrading to the new Anvil version require rewriting existing view code?","acceptedAnswer":{"@type":"Answer","text":"Yes, the rewrite is a breaking change to Anvil's API. The view() method now returns void instead of a virtual layout tree, view construction switches from a functional to an imperative style, and a new end-of-view marker function (named 'o' or 'x') is required to disambiguate nested view groups, since Java's left-to-right argument evaluation alone cannot reconstruct the tree. Developers planning a migration off an older Anvil API can keep tabs on breaking changes via daily.dev."}}]}
```

