Code Monkey home page Code Monkey logo

Comments (3)

pwt avatar pwt commented on June 12, 2024 2

Hi @falkoschindler

Does that solution work for you?

Yes -- thanks for the diagnosis.

from nicegui.

pwt avatar pwt commented on June 12, 2024

Thanks for converting this into an issue.

It looks like using ui.run(reload=False) fixes the issue, which is actually fine for my purposes.

from nicegui.

falkoschindler avatar falkoschindler commented on June 12, 2024

@pwt I think I found the reason for 100% CPU usage: You're copying the nicegui-test.py into the root directory /, which will also be the working directory when running the NiceGUI app. But this causes the reload watchdog to watch the whole disk, which is pretty costly. By moving the working directory somewhere else, the CPU drops to around 0.5% on my machine:

FROM python:3.12-slim
RUN pip install --root-user-action=ignore --disable-pip-version-check --no-cache-dir nicegui
WORKDIR /root
COPY nicegui-test.py nicegui-test.py
CMD python nicegui-test.py

Does that solution work for you?

from nicegui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.