ton-society / grants-and-bounties

TON Foundation invites talent to imagine and realize projects that have the potential to integrate with the daily lives of users.
https://ton.org/grants
295 stars 133 forks source link

Contract profiler #93

Closed ProgramCrafter closed 10 months ago

ProgramCrafter commented 1 year ago

Summary

Contract emulator that can show number of times each instruction is ran and how much gas does it cost.

Context

Such tool would be useful for optimizing gas usage and therefore would cut down on contract fees.

Goals

Create crossplatform profiler for TON contracts.

Deliverables

Definition of Done

Reward

Gusarich commented 1 year ago

@ProgramCrafter Are you sure it will be really useful to just show how many times each TVM instruction had been called? Anyway, I think it'll be a lot easier to implement using ton-contract-executor or sandbox without any dockers and without compiling binaries.

ProgramCrafter commented 1 year ago

Both of these have VM implemented as WASM blob, so it's not obvious how to patch them:

ProgramCrafter commented 1 year ago

Features set can be extended and balanced with the reward, for sure 😀 For example, profiler could dump information in some standartized format.

delovoyhomie commented 12 months ago

Indeed, the idea is quite commendable. @ProgramCrafter, the discussion is still pending. If the topic remains relevant, let's push to fine-tune it, or we will be compelled to close the discussion after two weeks.

@ProgramCrafter, what do you think?

ProgramCrafter commented 12 months ago

@delovoyhomie It turns out that there is already such a tool for Fift! https://github.com/tact-lang/ton-coverage

изображение (example from the repository)

It would be nice, then, to add support of higher-level languages!

delovoyhomie commented 10 months ago

This issue has been automatically closed due to 14 days of inactivity and lack of the additional information requested. Please feel free to reopen it if you wish to provide further details or require assistance.