-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External benchmarks for older solc versions #15561
Conversation
Benchmark resultsValues averaged over 2 runs. Compilation time
Peak memory use
|
SummaryOverall impactOverall we can summarize that compared to 0.8.18 compilation time went down by:
Or, compared to 0.8.15, which seems to have been the slowest:
This is of course for older versions of projects, which should be noted:
But this is in line with what we're seeing in incomplete data for newer versions. If anything, the newer versions seem to benefit more from these changes. Plots vs changelogThe plots seem to mostly align with the entries from the changelog that I expected to have the biggest impact:
There were a lot of smaller optimizations in optimizer steps before 0.8.21, but I'm not sure they are all listed in the changelog. Surprisingly, their impact seems to have been either very limited or overshadowed by other changes, because, at least based on the data we have here, the compilation time only started going significantly down with 0.8.21. |
e2dc74c
to
43f97b1
Compare
- Also use explicit versions for all projects
43f97b1
to
249c335
Compare
We could have a plot with the speedup with respect to baseline (oldest version), so |
Here's an attempt at the relative plots. Turned out surprisingly well despite the fact that we don't have a common baseline. I guess that's because the plots do mostly line up in the middle part. Script used to generate the plots# Uses imports, data and `column()` from the previous script.
def make_relative(values, reference_value):
return [
round(value / reference_value * 100) if value is not None else None
for value
in values
]
(figure, axes) = plt.subplots(figsize=(20, 10))
axes.set_title("Change in compilation time of benchmarked projects across compiler versions, compared to solc 0.8.18")
axes.set_xlabel("solc version")
axes.set_ylabel("Compilation time (% of 0.8.18 time)")
for y_column in [4, 5, 8]:
x_values = column(time, 0)
y_values = column(time, y_column)
reference_value = y_values[x_values.index("0.8.18")]
plot = axes.plot(x_values, make_relative(y_values, reference_value), label=time[0][y_column])
axes.set_ylim(bottom=0)
axes.set_xlim(left=0)
axes.legend()
axes.grid()
plt.savefig('compilation-time-change-vs-0.8.18.svg')
(figure, axes) = plt.subplots(figsize=(20, 10))
axes.set_title("Change in compilation time of benchmarked projects across compiler versions (normalized)")
axes.set_ylabel("Compilation time (% of worst time)")
for y_column in [4, 5, 8]:
x_values = column(time, 0)
absolute_y_values = column(time, y_column)
reference_value = max(x for x in absolute_y_values if x is not None)
relative_y_values = make_relative(absolute_y_values, reference_value)
plot = axes.plot(x_values, relative_y_values, label=time[0][y_column])
first_non_empty_index = next(i for i, v in enumerate(absolute_y_values) if v is not None)
axes.annotate(
f"{absolute_y_values[first_non_empty_index]} s",
(x_values[first_non_empty_index], relative_y_values[first_non_empty_index])
)
axes.set_ylim(bottom=0)
axes.set_xlim(left=0)
axes.legend()
axes.grid()
plt.savefig('compilation-time-change-normalized.svg')
plt.show() |
Adds benchmarks for older OpenZeppelin and Uniswap versions, which can be compiled by older solc versions (down to 0.8.10 in some cases).
I also tried to quickly find some new projects that would compile with a larger range of solc versions. Two seemed promising: liquity and farcaster. Unfortunately they did not prove useful for this. They may be useful in general though so I'm still adding them.
Finally, the PR refactors the setup script to make it less repetitive, especially when using multiple versions of the same project.