hexMachina icon indicating copy to clipboard operation
hexMachina copied to clipboard

Remove dependencies to reduce final compiled file size

Open FrancisBourre opened this issue 9 years ago • 1 comments

From @FrancisBourre on August 14, 2016 8:1

This is long task, and it has few sub tasks. The final goal is to reduce the final compiled file size and for doing it we should remove all the unnecessary class dependencies.

I started today by removing all the classes used at compile-time (cf: XmlCompiler) You can check the commit here

I made a first test, and it's not bad for a 1st iteration. As you can see, it removed around 1500 lines from the final file. This task should be continued.

The next sub-task (it can be parallel) is a bit trickier. The idea is to make modifications in the framework source code to use the compiler in full DCE. As you can imagine, the main problems are based on injection systems. I got some ideas about how doing it. We could use macros to decide which classes should be compiled or not depending of the architecture of the application.

Copied from original issue: DoclerLabs/hexIoC#5

FrancisBourre avatar Aug 25 '16 19:08 FrancisBourre

NB: StateController and ContextFactory are removed by DCE and this crashes the final application. The workaround for now is to add @:keep metadata, but it's just a temporary workaround.

FrancisBourre avatar Aug 25 '16 19:08 FrancisBourre