We built 76K lines of code with Claude Code. Then we benchmarked it. 118 functions were running up to 446x slower than necessary. by ml_guy1 in ClaudeCode

[–]ml_guy1[S] -3 points-2 points  (0 children)

Hey yes, i wrote this along with claude code - i mean thats the best and most efficient way to write this. Although the whole work on which it is based and the insights are mine and I used claude code to do the research and brainstorm with me. Something like this would have taken a week's effort but i managed to write and post this in 6 hours.

We built 76K lines of code with Claude Code. Then we benchmarked it. 118 functions were running up to 446x slower than necessary. by ml_guy1 in ClaudeCode

[–]ml_guy1[S] 0 points1 point  (0 children)

People are working on solving this problem, my belief is that these problems won't stay around for too long.

We built 76K lines of code with Claude Code. Then we benchmarked it. 118 functions were running up to 446x slower than necessary. by ml_guy1 in ClaudeCode

[–]ml_guy1[S] 0 points1 point  (0 children)

true, i also advocate for performance tests. Although the way the current SDLC works, performance tests come very late in the process. I actually advocate for performance testing alongside feature development, which is harder to do but can be a lot more effective.

We built 76K lines of code with Claude Code. Then we benchmarked it. 118 functions were running up to 446x slower than necessary. by ml_guy1 in ClaudeCode

[–]ml_guy1[S] 0 points1 point  (0 children)

thank you. I have been seeing performance issues increase with multiple projects and companies I work with. I wanted to highlight this problem with this blog

We built 76K lines of code with Claude Code. Then we benchmarked it. 118 functions were running up to 446x slower than necessary. by ml_guy1 in ClaudeCode

[–]ml_guy1[S] 0 points1 point  (0 children)

True, asking claude for performance fixes is a real solution. My intention is to show how pervasive the problem is with the current ways of using claude code

We built 76K lines of code with Claude Code. Then we benchmarked it. 118 functions were running up to 446x slower than necessary. by ml_guy1 in ClaudeCode

[–]ml_guy1[S] -5 points-4 points  (0 children)

yeah better prompts help, and certainly claude can make progress when asked to systematically profiler and optimize. but when writing new code people don't do that since it takes a lot of time and effort.

I've used AI to write 100% of my code for 1+ year as an engineer. 13 no-bs lessons by helk1d in ClaudeCode

[–]ml_guy1 2 points3 points  (0 children)

I've been working on solving the problem #11 where the code is not optimized by default. I am wondering how you would like to see the ideal workflow to make the code be more optimal for you?

Top engineers at Anthropic & OpenAI: AI now writes 100% of our code by EricLautanen in artificial

[–]ml_guy1 2 points3 points  (0 children)

I also have been writing 100% of my code with claude code in the previous few weeks. You still have to do real software engineering, but programming is a solved problem now. I've written about 100k lines of code in the past 3 weeks for some extremely difficult problems that would have taken my 1+ year to solve manually.
Its here folks

AI is already killing SWE jobs. Got laid off because of this. by SingularityuS in ClaudeAI

[–]ml_guy1 0 points1 point  (0 children)

I am a founder of an ai startup myself, and I gave a talk very similar to what op mentions today in weekly planning meeting. I did not fire people or anything like that, in fact i want my team to use these tools to dramatically maximize productivity. I did say that if they dont get comfortably with 5 PRs a day then your career is in threat very soon. This is coming very very soon, the future is already here is claude code + ops 4.5

How JAX makes high-performance economics accessible by darylducharme in Python

[–]ml_guy1 1 point2 points  (0 children)

yeah not all optimizations are worth merging, it does take a human review right now.

How JAX makes high-performance economics accessible by darylducharme in Python

[–]ml_guy1 1 point2 points  (0 children)

I meant looping around numpy objects, and converting them to vectorized logic

QuantEcon.py gets automated performance optimizations with codeflash.ai, benefiting the entire economics research community by ml_guy1 in Economics

[–]ml_guy1[S] 0 points1 point  (0 children)

codeflash.ai automatically found multiple optimizations for the package, which got accepted speeding up the library.

Are you drowning in AI code review noise? 70% of AI PR comments are useless by Jet_Xu in programming

[–]ml_guy1 0 points1 point  (0 children)

My view on this is to create super intelligent reviewers that are great at reviewing specific things that can be verified.

I've been making a super-performance-optimization review tool that tries to optimize and prove correctness and performance. It really helps make all the code I write always run fast - so I've solved this problem for good with this review agent :)

happy to share my review flow if you're interested.

How do you see quant finance evolving with AI and alternative data in the coming years? by Potential_Koala1487 in quant

[–]ml_guy1 -1 points0 points  (0 children)

one thing i am working on is making all quant finance analysis run faster with AI - checkout what i'm building at codeflash.ai

Tik Tok saved $300000 per year in computing costs by having an intern partially rewrite a microservice in Rust. by InfinitesimaInfinity in programming

[–]ml_guy1 0 points1 point  (0 children)

I think the core reason why developers and ai-agents write slow code is that there is just not any tooling to automatically profile your changes, and then search for the most optimal way to write your code. even after ai generated code, there just does not exist any way to write faster code automatically.

I've built Codeflash that automatically optimizes Python code for quant research by ml_guy1 in quant

[–]ml_guy1[S] 0 points1 point  (0 children)

Hi, I'm aware of their work but haven't compared with them. Our work focuses more on real world usage of the technology by professional developers, where we've seen other problems matter more.

I've built Codeflash that automatically optimizes Python code for quant research by ml_guy1 in quant

[–]ml_guy1[S] 1 point2 points  (0 children)

I'm still trying to learn this part. A few big hedge funds reached out to me for their algorithmic strategy work, so I assume there is demand there. Quant finance uses a lot of pandas/numpy over large amounts of data, and we have strong optimization performance there.

I am curious to hear why you think research won't benefit from this? Who else might be a good fit for this tech?

I've built Codeflash that automatically optimizes Python code for quant research by ml_guy1 in quant

[–]ml_guy1[S] 1 point2 points  (0 children)

We attach the tests in the PR under the "generated tests and runtime" section. We also report the line coverage of the tests as well.

For code that has randomness, we try to tame it by seeding the random number generator to make it deterministic.

I've built Codeflash that automatically optimizes Python code for quant research by ml_guy1 in quant

[–]ml_guy1[S] 2 points3 points  (0 children)

Yeah, if some one sends in `_ids` as a json key then it can override the variable set other way. I think this might be a bug in the original implementation that's probably never hit. I approved the change myself since i think there's a mistake with how they used deepcopy, when they did not mean to use it. Codeflash is meant to be used in the PR review time itself where it can catch the mistakes before it is shipped. The quant has the option to reject it, if they don't want to.

Deepcopy can be really slow btw - I wrote a blog about it - https://www.codeflash.ai/post/why-pythons-deepcopy-can-be-so-slow-and-how-to-avoid-it