vlang / website

MIT License
62 stars 96 forks source link

Comparison with Go binary sizes #235

Closed todor2810 closed 1 year ago

todor2810 commented 1 year ago

On this page:

https://vlang.io/compare#go

One of the listed differences between V and Go is:

Much smaller binaries (a simple web server written in V is 65 KB vs 7 MB in Go)

However when I try to reproduce this I get a 700 KB binary. Steps I made:

System info:

Would it be a good idea to remove the concrete numbers and just leave "Much smaller binaries" so that users won't think they are mislead?

medvednikov commented 1 year ago

I think this is due to a recently updated ssl module (the ssl lib is now embedded).

I'll update the numbers today, thanks.

todor2810 commented 1 year ago

Thank you for the clarification :).

MatejMagat305 commented 1 year ago

I think this is due to a recently updated ssl module (the ssl lib is now embedded).

I'll update the numbers today, thanks.

@medvednikov Only question: the lib ssl is embeded default? I'm asking therefore in golang I was comfortable with function import work like that what I do not use (from package) it was deleted from compilation and more from main was deleted unused function, I'm not sure that I was clarify enought, therefore example:

package mymodule

func first(){
    ...
}
func second(){
    ...
}
....

when I import:

package main
import mymodule

func main(){
     mymodule.second()
}
func third(){
    ....
}

Here it woud be compile only second, but first and third would not be in binary I thought that is working in vlang too, isn't it?

medvednikov commented 1 year ago

Fixed.

medvednikov commented 1 year ago

@MatejMagat305

the lib ssl is embeded default?

only when importing net or http or vweb modules