---
title: "Discussion on \"The agent refactored that tiny function for clarity. It doubled the runtime.\" | Hashnode"
description: "Discussion on \"The agent refactored that tiny function for clarity. It doubled the runtime.\". A clean-looking diff passed every test. The function was called 40k times per request. We didn't notice until p95 spiked."
url: "https://hashnode.com/posts/agent-refactor-doubles-runtime/6ad27a4715278d924cebd773"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The agent refactored that tiny function for clarity. It doubled the runtime.](https://blogs.powerduck.com/agent-refactor-doubles-runtime?utm_source=hashnode&utm_medium=feed)

A clean-looking diff passed every test. The function was called 40k times per request. We didn't notice until p95 spiked.

Oct 16 · 3 min read · blogs.powerduck.com  
Read the article

-   [#aiagents](https://hashnode.com/tag/aiagents)
-   [#refactoring](https://hashnode.com/tag/refactoring)
-   [#performance](https://hashnode.com/tag/performance)
-   [#coding](https://hashnode.com/tag/coding)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
