Skip to content
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

perf: for loop and if #2140

Merged
merged 12 commits into from
Jun 19, 2024
Merged

perf: for loop and if #2140

merged 12 commits into from
Jun 19, 2024

Conversation

petar-dambovaliev
Copy link
Contributor

@petar-dambovaliev petar-dambovaliev commented May 17, 2024

solves this

Benchmarks

Master
BenchmarkIfStatement-10    	     238	   4967960 ns/op
BenchmarkForLoop-10    	          649	   1771728 ns/op

Current branch
BenchmarkIfStatement-10    	     366	   3316189 ns/op
BenchmarkForLoop-10    	         1143	    945930 ns/op

By avoiding the runtime type conversion, we can see that we almost doubled the performance of these statements.

@github-actions github-actions bot added the 📦 🤖 gnovm Issues or PRs gnovm related label May 17, 2024
@petar-dambovaliev petar-dambovaliev marked this pull request as ready for review May 17, 2024 13:42
Copy link

codecov bot commented May 17, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Project coverage is 54.61%. Comparing base (0ba53ac) to head (7de4be3).

Files Patch % Lines
gnovm/pkg/gnolang/preprocess.go 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2140      +/-   ##
==========================================
- Coverage   54.63%   54.61%   -0.02%     
==========================================
  Files         581      582       +1     
  Lines       77544    78372     +828     
==========================================
+ Hits        42363    42804     +441     
- Misses      32023    32358     +335     
- Partials     3158     3210      +52     
Flag Coverage Δ
gno.land 61.86% <ø> (ø)
gnovm 59.75% <95.83%> (-0.23%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@petar-dambovaliev petar-dambovaliev changed the title perf: for loop perf: for loop and if May 17, 2024
@zivkovicmilos zivkovicmilos linked an issue May 17, 2024 that may be closed by this pull request
gnovm/pkg/gnolang/preprocess.go Outdated Show resolved Hide resolved
gnovm/pkg/gnolang/preprocess.go Outdated Show resolved Hide resolved
gnovm/pkg/gnolang/preprocess.go Outdated Show resolved Hide resolved
gnovm/pkg/gnolang/preprocess.go Outdated Show resolved Hide resolved
@jaekwon jaekwon merged commit 71a298b into master Jun 19, 2024
48 checks passed
@jaekwon jaekwon deleted the for-perf branch June 19, 2024 05:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 🤖 gnovm Issues or PRs gnovm related
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

perf: make for loops and if statements faster
5 participants