Skip to main content
QUICK REVIEW

[Paper Review] Measuring the Runtime Performance of C++ Code Written by Humans using GitHub Copilot

Daniel Erhabor, Sreeharsha Udayashankar|arXiv (Cornell University)|May 10, 2023
Software Engineering ResearchComputer Science3 citations
TL;DR

This study evaluates the runtime performance of C++ code generated by GitHub Copilot versus human-written code through a user study with 32 systems programmers. Results show Copilot-aided solutions were significantly slower—26% slower on average for I/O operations and 15% for concurrent programming—indicating that while Copilot aids correctness, it may hinder performance optimization.

ABSTRACT

GitHub Copilot is an artificially intelligent programming assistant used by many developers. While a few studies have evaluated the security risks of using Copilot, there has not been any study to show if it aids developers in producing code with better runtime performance. We evaluate the runtime performance of C++ code produced when developers use GitHub Copilot versus when they do not. To this end, we conducted a user study with 32 participants where each participant solved two C++ programming problems, one with Copilot and the other without it and measured the runtime performance of the participants' solutions on our test data. Our results suggest that using Copilot may produce C++ code with (statistically significant) slower runtime performance.

Motivation & Objective

  • To investigate whether GitHub Copilot influences the runtime performance of C++ code produced by developers.
  • To assess whether Copilot steers developers toward slower or faster-performing code solutions.
  • To examine whether developer experience or familiarity with C++ affects performance outcomes when using Copilot.
  • To provide empirical evidence on the performance trade-offs of using AI-assisted coding in systems programming.
  • To inform best practices for integrating AI coding assistants in performance-critical software development.

Proposed method

  • Conducted a controlled user study with 32 experienced C++ developers solving two distinct programming problems: one involving I/O operations and one involving concurrent programming.
  • Each participant solved each problem twice—once with GitHub Copilot enabled and once without—using a within-subjects design to control for individual differences.
  • Measured and compared the runtime performance of all valid solutions on standardized test data sets for both problems.
  • Collected and analyzed video recordings of participants’ sessions to understand decision-making patterns during coding.
  • Administered post-task surveys to assess developer perceptions, preferences, and perceived influence of Copilot on their choices.
  • Used statistical hypothesis testing (t-tests) to evaluate the significance of performance differences between Copilot-aided and non-Copilot solutions.

Experimental results

Research questions

  • RQ1RQ0: Does using Copilot influence program correctness?
  • RQ2RQ1: Is there a runtime performance difference in code when using GitHub Copilot?
  • RQ3RQ2: Do Copilot’s suggestions sway developers towards or away from code with faster runtime performance?
  • RQ4RQ3: Do characteristics of Copilot users influence the runtime performance when it is used?

Key findings

  • Copilot-aided solutions were 26% slower on average than non-Copilot solutions for the I/O operations problem, with a statistically significant p-value of 0.0172.
  • For the concurrent programming problem, Copilot-aided solutions were 15% slower on average, though the difference was not statistically significant (p = 0.667).
  • Expert solutions to the problems achieved up to six times better runtime performance than the average Copilot-aided solution.
  • There was a strong positive correlation between the use of Copilot and slower runtime performance in the I/O problem, but a weak correlation in the concurrent programming problem.
  • Higher C++ expertise and familiarity with the language were associated with faster runtime performance, both with and without Copilot.
  • Copilot’s suggestions tended to steer developers toward solutions with worse runtime performance, especially in performance-sensitive domains like I/O and concurrency.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.