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

[GnoVM] Request: add simple way to get VM cycles used on specific call #1973

Open
leohhhn opened this issue Apr 23, 2024 · 6 comments
Open

Comments

@leohhhn
Copy link
Contributor

leohhhn commented Apr 23, 2024

Description

It would be great if we can have a simple way to see how many cycles a specific call has spent. For example, adding a --measure-cycles flag to gnokey would be an idea to start with.

@leohhhn leohhhn changed the title [GnoVM] Request: add simple way to get VM cycles on specific call [GnoVM] Request: add simple way to get VM cycles used on specific call Apr 23, 2024
@deelawn
Copy link
Contributor

deelawn commented Apr 24, 2024

The gas used should be a function of the cycles spent. Would an end user care how many cycles are used?

@leohhhn
Copy link
Contributor Author

leohhhn commented Apr 24, 2024

Are we sure that gas will be a function of cycles used? 😄

In any case, might be cool for debugging/metrics/stress testing.

@deelawn
Copy link
Contributor

deelawn commented Apr 24, 2024

Yes, it will be. Is your proposal to return VM cycles used like we return gas used when sending transactions via gnokey?

@leohhhn
Copy link
Contributor Author

leohhhn commented Apr 25, 2024

Correct!

@leohhhn
Copy link
Contributor Author

leohhhn commented Apr 25, 2024

For reference - it seems that the gno test binary already has an option for displaying cycles along with some other metrics - gno test . -v -print-runtime-metrics. This is an alright workaround, ie you can make a test simply calling the function you want to check cycles for:

func TestC(t *testing.T) {
	Render("")
}

Still, I would like to see a -debug or -mertrics option when using gnokey. WDYT?

@deelawn
Copy link
Contributor

deelawn commented Apr 25, 2024

I'm not sure I'm convinced. Maybe someone else can chime in on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

2 participants