widgetti / solara

A Pure Python, React-style Framework for Scaling Your Jupyter and Web Apps
https://solara.dev
MIT License
1.62k stars 105 forks source link

feat: improve logging of reactive variable changes #517

Open iisakkirotko opened 2 months ago

iisakkirotko commented 2 months ago

The way that the log_level-settings is set is kind of hacky right now, but we need to discuss implementing a real solution in a different way

iisakkirotko commented 2 months ago

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @iisakkirotko and the rest of your teammates on Graphite Graphite

iisakkirotko commented 2 months ago

So testing the performance, the cost is only at start-up of the server, but with this change it takes about 4s longer to start the server than without. I'll take a look at what part of the change requires so much time next week.

P.S. It seems like reactive variables get initialized twice?

maartenbreddels commented 2 months ago

This PR led to a discussion about logging, for that I opened an issue https://github.com/widgetti/solara/issues/527

maartenbreddels commented 2 months ago

Btw, I expected this PR to build on top of #515 ? Maybe a squash issue?

TODO:

iisakkirotko commented 2 months ago

Btw, I expected this PR to build on top of #515 ? Maybe a squash issue?

To me these changes feel unrelated (even though they both use inspect.stack()), since one is about logging, while the other is fixing an issue. You could also argue that #515 could be based on this one, and make use of var._varname.

iisakkirotko commented 2 months ago

The performance of various ways to get caller names was tested here, from which it's pretty fair to say that we chose the slowest way to do this initially. I'll take a look at using a rewriting this PR using one of the better performing methods.

render[bot] commented 1 month ago

Your Render PR Server URL is https://solara-stable-pr-517.onrender.com.

Follow its progress at https://dashboard.render.com/web/srv-co18g18l6cac73ftelk0.