Skip to content

I tried compiling a statement that prints hello world and found that the generated executable file is too large. Is there a way to reduce the execution volume? #1555

Answered by mvertes
BestQiang asked this question in Q&A
Discussion options

You must be logged in to vote

The size can be reduced by not including the full standard library symbols:

package main

import "github.com/traefik/yaegi/interp"

func main() {
  i := interp.New(interp.Options{})
  i.Eval(`println("Hello world")`)
}

The executable size is 6M instead of 24M if stdlib is included (i.Use(stdlib.Symbols)).

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@BestQiang
Comment options

@mvertes
Comment options

Answer selected by mvertes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1554 on May 24, 2023 07:09.