V: Unable to build a vweb app with production mode

Created on 10 Jun 2020  路  5Comments  路  Source: vlang/v

V version: latest sources
OS: Ubuntu 20.04 LTS

What did you do?
A minimal vweb app; all works when running in normal mode.

What did you expect to see?
When I compile for production, I expect the build to generate the optimized binary file.

What did you see instead?

>>> compiling vweb HTML template "index.html"
:65:1138: error: unused variable: `tmpl_res_index`

Thanks

Bug

All 5 comments

Sorry, would it be possible to comment out println statements in vweb (some is already under $if debug) ? To start do some benchmarks for example ...

I've removed all debug prints.

The warning fixed as well.

@medvednikov after the fix, just to give some info:
in Linux for a minimal vweb app (that reply only an hello world in json) is:
source: 836 bytes (with many comments inside)
binary normal: 357KB
binary (with production mode, using only the "-prod" flag): 52 KB
so this looks great !!
Thank you very much for all this.

Yeah, I'm super excited :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

markgraydev picture markgraydev  路  3Comments

XVilka picture XVilka  路  3Comments

radare picture radare  路  3Comments

penguindark picture penguindark  路  3Comments

oleg-kachan picture oleg-kachan  路  3Comments