Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate Proguard for additional backend optimiztion #192

Open
bixuanzju opened this issue Jun 4, 2015 · 1 comment
Open

Investigate Proguard for additional backend optimiztion #192

bixuanzju opened this issue Jun 4, 2015 · 1 comment
Assignees

Comments

@bixuanzju
Copy link
Contributor

http://proguard.sourceforge.net/

@tomtau
Copy link
Contributor

tomtau commented Aug 20, 2015

I made an artificial example:

type Doc[A] = {
  concat : A -> A -> A,
  nil    : A,
  text   : String -> A
};
let printAlg: Doc[String] = {
  concat = \(x: String) (y: String) -> x.concat(y),
  nil    = "",
  text   = \(x: String) -> x
};
let parens [A] (f: Doc[A]) (doc: A) = f.concat (f.concat (f.text "(") doc) (f.text ")");
let hello [A] (f: Doc[A]) = f.concat (f.text "Hello") (f.text ", world!");
let random = new java.util.Random( );
let veryBig = new java.math.BigInteger(3500, random);
{veryBig.nextProbablePrime();
        parens [String] printAlg (hello [String] printAlg) }

It's the pretty printer example with extra long running method calls (and its value isn't used). ProGuard has some optimizations for removing method calls (from JDK classes) without side-effects if their values aren't used.

$ time java -jar pretty.jar 
(Hello, world!)

real    1m4.217s
user    1m5.985s
sys 0m0.199s

$ time java -jar pretty-opt.jar 
(Hello, world!)

real    0m24.420s
user    0m26.119s
sys 0m0.160s

But it's an artificial example -- it'll be interesting to use ProGuard on some larger code that was written in SF -- I guess some of the parser combinators?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants