romainguy / kotlin-explorer

Desktop tool to quickly explore disassembled Kotlin code.
Apache License 2.0
732 stars 20 forks source link

Launch Some Task in Parallel to Speed Things Up #42

Closed alonalbert closed 2 months ago

alonalbert commented 2 months ago

javap and dexdump can be launched in the background while we continue processing.

I changed the semantics of Status to show what has already been done, rather that's being done now. This is because now, things can happen at the same time. For example:

Creating Java ByteCode & Creating Dex Dump would be set at almost the same time and we wouldn't see one of them.

I'm using an AtomicFloat to guard the step counter and I changed some of the launch(ui) to withContext(ui) where it wasn't blocking further processing.

Note that now, if javap or dexdump fails, we keep going so we don't set the progress to Done. I extracted the onStatusUpdate() for success and failure to a single call so we can easily see how many times we call getAndIncrement