How to optimize a function by maximizing 1 variable and minimizing another?
You can't.  The optimal solution is not well-defined.  In general there will be a range of tradeoffs between minimizing time and uncompressed size, and you haven't specified anything that would allow uniquely identifying which you want.

Your first step is that you need to specify a single objective function, where the goal is to find a solution that maximizes the objective function.  Then you can try applying standard methods from mathematical optimization, e.g., gradient descent, Newton's method, and so on.