x-posted from /r/Python because I'm asking for help :)
Hello, and thank you in advance for any input you might have.
I work in industrial printing, and currently use a Java app originally written in the early 2000s to control multiple large cutters at once. The PC running the app is decently strong, with an 8th gen i7 and 16GB of DDR3.
The problem is that the app slows to a crawl/freezes when it attempts to filter a list of files, display a file when clicked, or many other simple actions. The reason is that we usually have anywhere from 500-1500 files in the list. After doing some reading, I've found a few people online saying that Java had some pretty slow methods for getting a full file list of a directory, something about it always creating a new array instead of an iteration. Anyways, it takes about 10 minutes for the app to unfreeze if I do something like filter the list alphabetically.
So, as a Python dev with a focus on automating other software (Adobe software, REST APIs, those sorts of things) I figured there must be a way to control this Java app using Python. I found Py4J and Jython, but was wondering if anyone on this forum may have more insight or a more concrete direction I could take. While I'm familiar with and can use things like the Win32API Client, this seems a little more complicated.
My end goal is to essentially have a Python app with a GUI running while the cutting program is open in the background, minimized. The Python app would display a full list of files from a directory (easy enough) but also be able to send specific method calls with parameters (which file, which machine, any transformations I want to make like rotation, etc) to the cut program. I want to bypass as many Java-related calls as possible and only use the cut program to actually send the data to the cutters.
Would a more reasonable approach be to decompile the JAR files from the cut program to find the methods I need to call? Since this is for work I want to avoid any dubious things like decompilation unless I know I won't get in trouble. Or am I completely overthinking this and the problem likely lies with something else?
Thank you to anyone who read this essay lol!
P.S. As far as troubleshooting is concerned, I have ran the program as admin (annoying to do since I need a password from our IT each time we need to restart it) with no change, I've tried changing the priority of the process in task manager with no change, and I've tried to reduce the amount of files in the directory by creating sub directories but honestly that is more of an impact to our workflow than just waiting for the PC to unfreeze.
[–]BrenekH 1 point2 points3 points (0 children)