
Show HN: ScreenTray – A decent Electron app for sharing screenshots - DSnopov
http://screentray.com
======
DSnopov
Hi HN!

Several months ago I decided to build an app which would allow me to quickly
capture and annotate screenshots, upload them to Google Drive and wouldn't be
overloaded with features.

Since I'd mostly worked on web stuff, I chose Electron. A lot of developers
and other tech-savvy guys hate Electron apps for requiring more resources,
their poor performance or non-native feel. So I've done my best to mitigate
those issues. Just a few things I did:

1\. When a user starts dragging a mouse cursor to select an area of the screen
to capture, I open a hidden window to let Electron load resources. It is shown
immediately when the user finishes dragging. The annotation window startup
time decreased by 1 second because of this simple hack.

2\. All CPU intensive computations were moved to web workers in order not to
block the UI thread.

3\. I used as few external modules as possible. There are only 10 of them. The
whole app was built in vanilla javascript.

4\. Some other additional work to give a native feel to the app.

I'm pretty happy about the results. The app takes only 70-90 megabytes of RAM,
and it's not that much if you look at the competitors. It also allocates
additional resources for each window, but they are immediately deallocated as
soon as you close the window. ScreenTray is not a chat app, so you won't need
to keep them open ;-) The performance of the annotation window is decent,
although it's a little bit laggy when a screenshot is too big. The problem
here is that it's kind of an expensive operation to rerender a big canvas
element, and I'm not sure that I can optimize that.

Anyway, just let me know what you guys think. I will appreciate any feedback,
so be brutally honest! Thanks.

