# An Empirical Study of Gas Optimization Practices in Solidity Smart Contracts

DevFeed: [An Empirical Study of Gas Optimization Practices in Solidity Smart Contracts](<https://devfeed.tech/articles/an-empirical-study-of-gas-optimization-practices-in-solidity-smart-contracts-112667.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.40885>)

Author: Francesco Salzano, Paolo Martino, Simone Scalabrino, Rocco Oliveto, Remo Pareschi

Published: 2026-11-02T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [Solidity](<https://devfeed.tech/topics/solidity.md>), [Ethereum](<https://devfeed.tech/topics/ethereum.md>), [Architecture & optimization](<https://devfeed.tech/topics/architecture-optimization.md>)

Tags: [bytecode](<https://devfeed.tech/tags/bytecode.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [ethereum](<https://devfeed.tech/tags/ethereum.md>), [logic](<https://devfeed.tech/tags/logic.md>), [mining](<https://devfeed.tech/tags/mining.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [reduction](<https://devfeed.tech/tags/reduction.md>), [smart-contracts](<https://devfeed.tech/tags/smart-contracts.md>), [solidity](<https://devfeed.tech/tags/solidity.md>), [strategies](<https://devfeed.tech/tags/strategies.md>)

## AI overview

The study analyzes 400 representative gas-related commits from open-source Solidity repositories on GitHub (2018-2025), selected through NLP filtering and manual review. It classifies observed optimization practices into 8 macro-categories and 36 subcategories, ranging from arithmetic refinements and bytecode-size reduction to internalizing logic and reducing external calls. The findings show that developers balance execution frequency, safety checks, and gas costs, so optimization depends on the contract context. The abstract presents the taxonomy as a knowledge base for future developer-support tools.

## Source excerpt

arXiv:2610.40885v1 Announce Type: new 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.