Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI / Performance: Remove dependencies on AWT (system tray icon) #4940

Closed
cd2357 opened this issue Dec 13, 2020 · 9 comments
Closed

UI / Performance: Remove dependencies on AWT (system tray icon) #4940

cd2357 opened this issue Dec 13, 2020 · 9 comments

Comments

@cd2357
Copy link
Contributor

cd2357 commented Dec 13, 2020

As per https://stackoverflow.com/a/11121207 having AWT dependencies in a JavaFX application can lead to more CPU/RAM usage than necessary, because two separate graphics stacks are loaded and active at the same time.

From what I can tell, Bisq mainly uses AWT for the system tray icon.

If that's the case, then with AWT we have:

  • benefits: ability to show Bisq in the system tray
  • drawbacks: a separate graphics stack (older, superseded by JavaFX) loaded in Java, with possible impact on RAM and CPU usage

To me, it seems the drawbacks outweigh the benefits.

Therefore, I suggest to remove the AWT dependencies from Bisq (and with that, the system tray icon).

@cd2357 cd2357 added the in:gui label Dec 13, 2020
@cd2357
Copy link
Contributor Author

cd2357 commented Dec 13, 2020

Looks like we also use AWT for the webcam/QR code reader, via the class java.awt.image.BufferedImage.

As per https://stackoverflow.com/questions/30970005/bufferedimage-to-javafx-image there is a JavaFX equivalent to that.

@ripcurlx
Copy link
Member

Looks like we also use AWT for the webcam/QR code reader, via the class java.awt.image.BufferedImage.

As per https://stackoverflow.com/questions/30970005/bufferedimage-to-javafx-image there is a JavaFX equivalent to that.

Besides that it also stopped working with Catalina as it doesn't work without notarization anymore to access the webcam. So I think it would be good to tackle the webcam part anyways.

@ripcurlx
Copy link
Member

Related to #4374.

@jmacxx
Copy link
Contributor

jmacxx commented Dec 27, 2020

There remains outstanding issue of the library com.github.sarxos.webcam which uses awt in its public interface and so puts java.awt.image.BufferedImage and java.awt.Dimension into Bisq code. To remove awt from the runtime stack the whole webcam library will need to change.

@cd2357
Copy link
Contributor Author

cd2357 commented Mar 29, 2021

A good non-AWT webcam alternative might be JavaCV (see sample).

@ripcurlx
Copy link
Member

And we really need to get rid of it now:

{
  "logFormatVersion": 1,
  "jobId": "b28d2a4f-7f18-4539-ac05-a2858b7cf1f2",
  "status": "Invalid",
  "statusSummary": "Archive contains critical validation errors",
  "statusCode": 4000,
  "archiveFilename": "Bisq-1.6.2.dmg",
  "uploadDate": "2021-04-14T08:20:07Z",
  "sha256": "4e4258559e1765428b067697c810cc4c05394fd87c393b21d3b9d43b1d8890d3",
  "ticketContents": null,
  "issues": [
    {
      "severity": "error",
      "code": null,
      "path": "Bisq-1.6.2.dmg/Bisq.app/Contents/app/desktop-1.6.2-SNAPSHOT-all.jar/com/github/sarxos/webcam/ds/buildin/lib/darwin_universal/libOpenIMAJGrabber.dylib",
      "message": "The binary uses an SDK older than the 10.9 SDK.",
      "docUrl": null,
      "architecture": "i386"
    },
    {
      "severity": "error",
      "code": null,
      "path": "Bisq-1.6.2.dmg/Bisq.app/Contents/app/desktop-1.6.2-SNAPSHOT-all.jar/com/github/sarxos/webcam/ds/buildin/lib/darwin_universal/libOpenIMAJGrabber.dylib",
      "message": "The binary uses an SDK older than the 10.9 SDK.",
      "docUrl": null,
      "architecture": "x86_64"
    }
  ]
}

It prevents us to build notarized versions now for macOS as well.

@ripcurlx
Copy link
Member

I'll give JavaCV a shot if I'm able to port our QR-Code reader to this supported lib.

@stale
Copy link

stale bot commented Jul 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the was:dropped label Jul 21, 2021
@stale
Copy link

stale bot commented Sep 6, 2021

This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant.

@stale stale bot closed this as completed Sep 6, 2021
devinbileck added a commit to devinbileck/bisq that referenced this issue Mar 1, 2024
This restores the functionality that was removed in b5beea5. However,
this implementation utilizes the JavaCV library rather than the
webcam-capture library as discussed in bisq-network#4940. As a result, this should
now provide macOS support.
devinbileck added a commit to devinbileck/bisq that referenced this issue Apr 4, 2024
This restores the functionality that was removed in b5beea5. However,
this implementation utilizes the JavaCV library rather than the
webcam-capture library as discussed in bisq-network#4940. As a result, this should
now provide macOS support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants