I found two more functions in my Rust program that could be replaced with specifications and generated with AI. I decided to test some AI chat bots to see if I could improvement my implementations.
First I tried DeepSeek V4.1 Flash, but it gave me an implementation that was hard to read, almost like spaghetti code. It also seemed to cause a tiny performance regression. I decided to try a different model.
I tried the specification prompts in Claude Sonnet 5.5. This fixed the performance regression, and yielded better, more readable code. So I ended up spending about $0.06 on Sonnet today to generate 2 Rust functions.
In this case, Sonnet was clearly superior to DeepSeek V4.1 Flash, and only 2-3 times more expensive. It seems that mass copyright infringement has really helped Anthropic improve their models.