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

refactor(stdlib): optimized emptyCell() and emptySlice() #1696

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Shvandre
Copy link
Contributor

@Shvandre Shvandre commented Feb 4, 2025

Issue

Closes #1693 .

Benchmarks:

Optimization of emptyCell()

Expected :1449n
Actual :931n

Optimization of emptySlice()

Snapshot: 1667n
Received: 1035n

Checklist

  • I have updated CHANGELOG.md
  • I have run all the tests locally and no test failure was reported
  • I have run the linter, formatter and spellchecker
  • I did not do unrelated and/or undiscussed refactorings

@Shvandre Shvandre requested a review from a team as a code owner February 4, 2025 11:29
Copy link
Member

@anton-trunov anton-trunov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a benchmark!

@anton-trunov anton-trunov self-assigned this Feb 4, 2025
@anton-trunov anton-trunov added this to the v1.6.0 milestone Feb 4, 2025
@anton-trunov anton-trunov changed the title refactor: optimized emptyCell() and emptySlice() refactor(stdlib): optimized emptyCell() and emptySlice() Feb 4, 2025
@Shvandre
Copy link
Contributor Author

Shvandre commented Feb 5, 2025

Optimization of emptyCell()

Expected :1449n
Actual :931n

Optimization of emptySlice()

Snapshot: 1667n
Received: 1035n

b4cksl4sh and others added 2 commits February 5, 2025 21:58
# Conflicts:
#	src/stdlib/stdlib.ts
#	src/test/benchmarks/benchmarks.spec.ts
@Shvandre Shvandre requested a review from i582 February 5, 2025 19:03
await testContract.send(
treasure.getSender(),
{ value: toNano(1) },
beginCell().asSlice(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually we just define receive() {} and pass null here

@@ -0,0 +1,11 @@
contract cellsCreation {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CellsCreation

Co-authored-by: Anton Trunov <anton@ton.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize emptyCell and emptySlice stdlib functions
3 participants