@@ -0,0 +1,2232 @@
+package no.birkett.kiwi;%0A%0Aimport java.util.HashMap;%0A%0A/**%0A * Created by alex on 27/11/2014.%0A */%0Apublic class Benchmarks %7B%0A%0A    public static void testAddingLotsOfConstraints() throws DuplicateConstraintException, UnsatisfiableConstraintException %7B%0A        Solver solver = new Solver();%0A%0A        final HashMap%3CString, Variable%3E variables = new HashMap%3CString, Variable%3E();%0A%0A        ConstraintParser.CassowaryVariableResolver variableResolver = new ConstraintParser.CassowaryVariableResolver() %7B%0A%0A            @Override%0A            public Variable resolveVariable(String variableName) %7B%0A                Variable variable = null;%0A                if (variables.containsKey(variableName)) %7B%0A                    variable =  variables.get(variableName);%0A                %7D else %7B%0A                    variable = new Variable(variableName);%0A                    variables.put(variableName, variable);%0A                %7D%0A                return variable;%0A            %7D%0A%0A            @Override%0A            public Expression resolveConstant(String name) %7B%0A                try %7B%0A                    return new Expression(Double.parseDouble(name));%0A                %7D catch (NumberFormatException e) %7B%0A                    return null;%0A                %7D%0A            %7D%0A        %7D;%0A%0A        solver.addConstraint(ConstraintParser.parseConstraint(%22variable0 == 100%22, variableResolver));%0A%0A        for (int i = 1; i %3C 3000; i++) %7B%0A            String constraintString  = getVariableName(i) + %22 == 100 + %22 + getVariableName(i - 1);%0A%0A            Constraint constraint = ConstraintParser.parseConstraint(constraintString, variableResolver);%0A%0A            System.gc();%0A            long timeBefore = System.nanoTime();%0A%0A            solver.addConstraint(constraint);%0A%0A            System.out.println(i + %22,%22 + ((System.nanoTime() - timeBefore) / 1000) );%0A        %7D%0A%0A%0A    %7D%0A%0A    private static String getVariableName(int number) %7B%0A        return %22getVariable%22 + number;%0A    %7D%0A%0A    public static void main(String %5B %5D args) %7B%0A        try %7B%0A            testAddingLotsOfConstraints();%0A        %7D catch (DuplicateConstraintException e) %7B%0A            e.printStackTrace();%0A        %7D catch (UnsatisfiableConstraintException e) %7B%0A            e.printStackTrace();%0A        %7D%0A    %7D%0A%0A%7D%0A

Add benchmarks