Jump to content

Alfred workflow please support Java


ifvsvg

Recommended Posts

Please support Java in workflow ~~!

 

Since I'm a java programmer and I'm familiar with Java, if I want to write a complex workflow using python, then I will spend a lot of time to learn python and all kind of library, it's really inconvenient.

 

There are more and more Java programmer, so please support Java in workflow ~!

Link to comment
Share on other sites

It’s not an issue, it’s a thread, so no need to close it. 

 

You don’t need a library to write workflows. They were more important in Alfred 2, where you had to generate XML for Script Filters and do your own result filtering. Alfred 3 uses JSON and can filter results for you.

 

Be warned that Java is not a good fit for workflows, however. Workflows are very short-lived processes, and Alfred tries to run Script Filters every time the query changes (i.e. on every keypress).

 

So Java’s slow start-up time makes it a really bad choice for workflows.

Link to comment
Share on other sites

Java is that fast? I was expecting more like 500ms. I’d be interested to hear how it does when you load more libraries to do something useful. 

 

160ms is about the load time for a large Python or Ruby workflow (i.e. including quite a lot of libraries).

 

Obviously, they don’t run anywhere near as fast as Java, though.

Link to comment
Share on other sites

  • 1 year later...

@deanishe I have an app, written in kotlin, that is packaged as a 22Mb fat jar file.  Libraries are non-trivial -- sqlite, micronaut, picocli, kotlin statistics.  There's really no need for micronaut in this app, but I'm experimenting with it, so there it is.  I have not yet done any testing with Alfred

 

The app does a read-only query on the sqlite database of the application "Bear" to get the text of all the notes modified in the last month, then does some regex matching on note text to find certain things and compile a little report that is formatted as a markdown outline.  My current Bear database isn't very large, but grows every day.  This application runs (timed by the unix 'time' command) from the command line in about 180ms.

 

Startup time is, indeed, java's weakness when compared to something like a shell script. But if you don't use reflective DI frameworks like Spring you can keep things reasonable.

Link to comment
Share on other sites

5 minutes ago, kastork said:

Startup time is, indeed, java's weakness when compared to something like a shell script. But if you don't use reflective DI frameworks like Spring you can keep things reasonable.

 

Yeah. I've been using a few command-line Java programs recently, and I've come to the conclusion that the problem isn't Java itself, but the way a lot of Java developers use it.

Link to comment
Share on other sites

  • Vero locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...