Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. High cpu usage of setPersistentStoragePath

High cpu usage of setPersistentStoragePath

Scheduled Pinned Locked Moved Unsolved QtWebEngine
2 Posts 2 Posters 172 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MasterJohnsonM Offline
    MasterJohnsonM Offline
    MasterJohnson
    wrote on last edited by MasterJohnson
    #1
    if __name__ == '__main__':
        import sys
    
        app = QApplication(sys.argv)
        views = []
    
        for i in range(5):
            time.sleep(1)
            webview = QWebEngineView()
            profile = QWebEngineProfile(f"storage{i}", webview)
            profile.setPersistentStoragePath(f"profiles/storage{i}")
            webpage = QWebEnginePage(profile, webview)
            webview.setPage(webpage)
            webview.load(QUrl("https://www.google.com/"))
            webview.show()
            views.append(webview)
    
        sys.exit(app.exec())
    

    This is a test code I’ve written. My goal is to save cookies with minimal CPU usage.

    The CPU usage is quite high, around 60–70%. Is that normal? Normal browsers use almost no CPU, so I’m wondering if there’s something I can do about it.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you using PySide ? PyQt ?
      Which version of it ?
      On which OS ?
      How did you install it ?
      Which version of Python ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved