HTML5 Canvas Gauge. Tiny implementation of highly configurable gauge using pure JavaScript and HTML5 canvas. No dependencies. Suitable for IoT devices because of minimum code base.
First of all, love the gauges, they are super pretty and work really nicely.
However, the default Mutation Observer model is extremely resource heavy. I can be on a page that has no gauges and the majority of CPU is taken up looking for dom changes. Had I not been profiling my code extensively, and know how to understand these results I would not have picked up on it. Its likely others would never be aware of such issues.
As such I'd like to propose changing the default mutation observer to disabled. That way its far more performant out the box.
Some details:
On page change, almost 500ms is spent in Gauge code tracking observations. Note this is simply from having the JS loaded. No gauges were ever created
On page change observe is called about 30 times, and process about 3500 times. This is of course very subjective to my page, so take with a pinch of salt, I just wanted to highlight the issues I am having.
Hi.
First of all, love the gauges, they are super pretty and work really nicely.
However, the default Mutation Observer model is extremely resource heavy. I can be on a page that has no gauges and the majority of CPU is taken up looking for dom changes. Had I not been profiling my code extensively, and know how to understand these results I would not have picked up on it. Its likely others would never be aware of such issues.
As such I'd like to propose changing the default mutation observer to disabled. That way its far more performant out the box.
Some details: