Code Generation by Large Language Models: A Comparative Analysis of ChatGPT, Claude, and DeepSeek

Read full text
Authors: Yousef Alraba’nah, Azzam Sleit, Iyas Qaddara, Mohammad Hiari
Cited by: 2

Abstract

As generative Artificial Intelligence (AI) models become increasingly integrated into software development workflows, understanding their efficiency and code quality is critical. This study offers a comprehensive comparison of three leading AI models—ChatGPT GPT-4-turbo, Claude Sonnet, and DeepSeek-V3—for automated code generation, focusing specifically on sorting algorithms. The models are evaluated across multiple metrics including execution time, memory usage, peak memory consumption, logical and physical file sizes, and code readability. Python implementations of Insertion Sort, Merge Sort, Quick Sort, and Heap Sort are generated by each model and benchmarked in a consistent Linux Docker environment. Results reveal that ChatGPT leads in overall efficiency, with the fastest average execution time, the lowest peak memory usage, and the highest readability scores. DeepSeek demonstrated competitive performance, especially in producing readable code, while Claude showed higher memory consumption and lower readability. This analysis provides practical insight into the trade-offs between code quality and system performance in AI-generated programming, offering valuable guidance for researchers and developers alike.

Fields of Study & Subjects

Artificial Intelligence in Healthcare and Education Software Engineering Research Scientific Computing and Data Management

Publication details

Journal / source
International Journal of Electrical and Electronic Engineering & Telecommunications
Publisher
EJournal Publishing
Volume
15
Issue
1
Pages
19–28
Publication date
1 January 2026