ExCS: accelerating code search with code expansion.

Sci Rep

School of Cyber Science and Engineering, Wuhan University, Wuhan, 430072, China.

Published: November 2024

Efficiently searching and reusing code from expansive codebases is pivotal for enhancing developers' productivity. In recent times, the emergence of deep learning-driven neural ranking models, characterized by their vast dimensions and intricate interaction mechanisms, has been noteworthy. Yet, these models, in real-world scenarios, pose computational challenges due to their high dimensionality. Moreover, models rooted in interaction necessitate querying every piece of code within a voluminous corpus. While these methodologies offer superior accuracy, their online retrieval process is considerably more time-consuming compared to traditional Information Retrieval (IR) techniques. Addressing this, we introduce "ExCS", an innovative code search tool designed to expedite the code search process without compromising on accuracy. ExCS innovatively employs code expansion in its offline phase, leveraging predictions on potential queries for specific codes, thereby enriching the code's semantic depth. During online retrieval, ExCS prioritizes IR-based methods to pinpoint a concise set of persuasive candidates. Our evaluations, conducted on the Java dataset from CodeSearchNet, reveal that ExCS achieves a remarkable 90% reduction in retrieval duration while maintaining an impressive 99% retrieval accuracy.

Download full-text PDF

Source
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC11589884PMC
http://dx.doi.org/10.1038/s41598-024-73907-6DOI Listing

Publication Analysis

Top Keywords

code search
12
code expansion
8
online retrieval
8
code
7
retrieval
5
excs
4
excs accelerating
4
accelerating code
4
search code
4
expansion efficiently
4

Similar Publications

Want AI Summaries of new PubMed Abstracts delivered to your In-box?

Enter search terms and have AI summaries delivered each week - change queries or unsubscribe any time!