java-decompiler icon indicating copy to clipboard operation
java-decompiler copied to clipboard

Memory map class format

Open Caellian opened this issue 2 years ago • 0 comments

Given that it's unlikely this crate will ever need to generate class files. A very nice optimization that's possible is memory mapping the class file. This would essentially remove all branches that occur while reading class files. I got the idea from harfbuzz and fontations.

This choice does however make writing either complicated by requiring the use of a builder pattern, or slow by requiring explicit memory moves every write operation.

Largest scope of this project includes modification of the class files to allow diff-patching their bytecode though this is unlikely to be implemented in foreseeable future.

This is also not a priority until decompilation is on par with other decompilers. Current class file reading performance isn't the worst.

Fontations are a good example of how to do this. Ideally this feature should be implemented alongside a specification parser to ensure parsing code matches the spec exactly.

Caellian avatar Oct 30 '23 16:10 Caellian