core icon indicating copy to clipboard operation
core copied to clipboard

Profile and optimize

Open kkoreilly opened this issue 2 years ago • 6 comments

We could probably improve performance a decent amount by profiling and optimizing, which would be helpful for lower capacity platforms like web.

kkoreilly avatar Dec 25 '23 00:12 kkoreilly

When we do this, we should do widget-specific render profiling using PushBounds and PopBounds.

kkoreilly avatar Jan 19 '24 20:01 kkoreilly

Some data points:

  • Running the demo on my laptop (2016 Intel-based Macbook Pro) and just leaving it idle seems to peg the fans.

  • I ran the demo in my browser and it seemed to use much less energy(?); in any case it didn't spike my laptop fans. So that was a bit of a surprise, that running wasm in Chrome took less (fewer?) resources than a native app.

  • I played around with this a lot a few days ago, looking at other measurements than just fan speed. It turns out that the demo draws 9-11 watts on the "CPU Package GPU", as reported by iStat Menus. Other GPU readings (Intel and Radeon) also report higher readings (temperature, wattage, and others). I mean, it's super clear: ~0 watts in use (on that measurement), then I start the demo, and it climbs to 9+ watts almost immediately, and when I exit the demo, it drops back to 0W again.

  • I should also mention that I normally use an external monitor, which makes my mac use a different graphics card (Radeon), and also (I didn't actually realize this till fiddling with this) heats it up a significant amount. Routing all that data through the usb-c port takes a not-insignificant amount of energy, who knew?

    So the extra load from the demo (9 watts!) may just be enough to push my specific laptop with my specific usage pattern over some threshold where it has to rev the fans more to dissipate the extra heat being generated.

theclapp avatar Jul 28 '24 15:07 theclapp

It would be beneficial to get some performance improvements done soon. The attraction of using Cogent Core versus say web technologies is the ability to handle and visualise large datasets. At the moment, the table struggles with scrolling with large amounts of data (https://github.com/cogentcore/core/issues/1128)

runrc avatar Oct 16 '24 18:10 runrc

@runrc Thank you for pinging us on this issue. We have been busy for various reasons as I explain below, but we will have more time soon to improve Cogent Core, and we will prioritize #1128 first.

We have been busy with the start of the academic year, particularly with updating all of the Computational Cognitive Neuroscience simulations to Cogent Core, which are actively needed each week for courses at three universities, and thus present pressing deadlines. Also, @rcoreilly has been working on Goal (#1229), which is needed for his continued scientific research and will be beneficial in general for data science with Cogent Core. However, we are at the tail end of both projects, and thus we will have much more time to dedicate to things such as table performance shortly.

kkoreilly avatar Oct 16 '24 19:10 kkoreilly

@runrc We made good progress on the aforementioned projects, so we have more time to improve Cogent Core now. We fixed #1128 and I will fix your race condition issues shortly.

kkoreilly avatar Nov 02 '24 04:11 kkoreilly

For more discussion of performance issues, see https://github.com/cogentcore/core/discussions/1407#discussioncomment-11737487.

kkoreilly avatar Jan 05 '25 05:01 kkoreilly