arXiv preprint ·

An Empirical Study of Gas Optimization Practices in Solidity Smart Contracts

Francesco Salzano, Paolo Martino, Simone Scalabrino, Rocco Oliveto and Remo Pareschi

Published
Source
arXiv preprint, posted before peer review
Original
Read it at arXiv
Topics
Software Engineering

Abstract

In the Ethereum ecosystem, smart contract execution is governed by a gas model where every computational operation incurs a direct economic cost. Consequently, gas efficiency is a critical requirement for the economic sustainability and widespread adoption of decentralized applications. Despite the importance of cost-effective development, there remains a significant gap between theoretical optimization patterns and the actual practices applied by developers in real-world projects. This paper presents an empirical study investigating gas optimization practices in open-source Solidity repositories created on GitHub between 2018 and 2025. Adopting a Mining Software Repositories approach, we analyzed a dataset of gas-related commits identified through a multi-stage pipeline involving NLP-based filtering and manual qualitative inspection. Based on the analysis of 400 representative commits, we derive an empirical taxonomy of gas optimization strategies consisting of 8 macro-categories and 36 subcategories. Our findings reveal that optimization efforts span multiple levels of abstraction, from low-level arithmetic refinements and bytecode-size reductions to broader architectural changes such as logic internalization and external call reduction. Furthermore, we observe that developers often manage complex trade-offs between execution frequency, safety checks, and computational costs, highlighting that effective optimization is inherently context-dependent. This study provides a practical knowledge base for the design of future developer support tools and advances the understanding of cost-aware software engineering in the blockchain domain.

The authors’ abstract, as arXiv lists it. arXiv’s listings, abstracts included, are free for anyone to reuse.

Read it on ReadSearch

Each opens after you create an account, and brings you back to this paper.

Already a reader? Sign in

All new papers in Software Engineering

Get the few papers worth your time in Software Engineering every morning.

ReadSearch reads the new papers in your field each day and brings you the few worth reading, each with its key finding in a sentence.

Papers belong to their authors and publishers; every page here links to the original. All research topics