Learning based Methods for Code Runtime Complexity Prediction

11/04/2019
by   Jagriti Sikka, et al.
0

Predicting the runtime complexity of a programming code is an arduous task. In fact, even for humans, it requires a subtle analysis and comprehensive knowledge of algorithms to predict time complexity with high fidelity, given any code. As per Turing's Halting problem proof, estimating code complexity is mathematically impossible. Nevertheless, an approximate solution to such a task can help developers to get real-time feedback for the efficiency of their code. In this work, we model this problem as a machine learning task and check its feasibility with thorough analysis. Due to the lack of any open source dataset for this task, we propose our own annotated dataset CoRCoD: Code Runtime Complexity Dataset, extracted from online judges. We establish baselines using two different approaches: feature engineering and code embeddings, to achieve state of the art results and compare their performances. Such solutions can be widely useful in potential applications like automatically grading coding assignments, IDE-integrated tools for static code analysis, and others.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/10/2023

Measuring the Runtime Performance of Code Produced with GitHub Copilot

GitHub Copilot is an artificially intelligent programming assistant used...
research
08/09/2022

Learning to Improve Code Efficiency

Improvements in the performance of computing systems, driven by Moore's ...
research
09/30/2021

Predicting Code Review Completion Time in Modern Code Review

Context. Modern Code Review (MCR) is being adopted in both open source a...
research
05/31/2023

CodeTF: One-stop Transformer Library for State-of-the-art Code LLM

Code intelligence plays a key role in transforming modern software engin...
research
10/28/2021

On the Importance and Shortcomings of Code Readability Metrics: A Case Study on Reactive Programming

Well structured and readable source code is a pre-requisite for maintain...
research
06/18/2019

A Static Analysis-based Cross-Architecture Performance Prediction Using Machine Learning

Porting code from CPU to GPU is costly and time-consuming; Unless much t...
research
12/12/2021

Nalin: Learning from Runtime Behavior to Find Name-Value Inconsistencies in Jupyter Notebooks

Variable names are important to understand and maintain code. If a varia...

Please sign up or login with your details

Forgot password? Click here to reset