vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.79k stars 2.16k forks source link

gui program cpu consumption is too high #14691

Open xiaoshengduan opened 2 years ago

xiaoshengduan commented 2 years ago

The clock example, or most gui examples, have problems with excessive gpu and cpu consumption。 Compared with the same examples in other languages such as rust and golang, it is more than 10 times higher

T@%0Q7IX$({1Y 0F)9%44Q

Corallus-Caninus commented 2 years ago

are you compiling with the -prod flag and clang backend? also are you using GC boehm or autofree with GC none?

xiaoshengduan commented 2 years ago

v -autofree -prod -stats clock.v

medvednikov commented 2 years ago

I was able to reproduce it. There's ui mode in gg which limits number of redraws per second, but it can't apply here, since everything is refreshed frequently (the arrow is constantly moving).

xiaoshengduan commented 2 years ago

Almost all gui demo programs have this problem