~/bend-docscommunity

performance/drop_in_bang.bend fails

raw source on the hub · import bend-lint-rules@0.1.0.0/performance/drop_in_bang.bend as Drop_in_bang

performance/drop_in_bang: a ! call of a definition that returns Unit: Base's Image.drop, Image.free or Image.sink, or a definition of the program declared -> Unit. A pure definition that returns Unit does nothing but free what it receives, and a GPU frees slower than its CPU. Heuristics: measured on a discrete GPU (CUDA), 30 frames that each dropped a 1M-leaf image with Image.drop! took 1.55 s, against 0.10 s with Image.drop (0.104 s against 0.094 s with --gpu off). "bend guide shaders" measured freeing Bend's slash boss scene in a bang at 12.9 ms a frame, against 8.0 ms, on an Apple M-series GPU, whose memory is unified: the GPU loses on both kinds of memory. The JS lane has no GPU. A return type written another way (an alias of Unit) is not known.

4 imports
import Base
import bend-lint-api@0.1.0.0/linter/lint.bend as Lint
import bend-lint-api@0.1.0.0/shared/names.bend as Names
import ./gpu_fit.bend as GpuFit