26 Commits (3cdca37e8588d262efbb3b589f8a68eea73738a2)

Author SHA1 Message Date
Jordi Boggiano abdc6893a6
Add void types where no return statement is present 2 years ago
Jordi Boggiano 2a771dfb2d
Update PHPUnit to 8.5 3 years ago
Jordi Boggiano c3c6969cf5
Type annotations 3 years ago
Jordi Boggiano 4bcd860b65
Add more type annotations 3 years ago
Jordi Boggiano b7d770659b
CS fixes 4 years ago
Jordi Boggiano 1ea3111583
Use RULE_LEARNED instead of RULE_FIXED 4 years ago
Jordi Boggiano 5e5f9f8142
Remove unused RULE_INTERNAL_ALLOW_UPDATE 4 years ago
Jordi Boggiano 45ecbae8f5
Merge branch 'master' into 2.0 4 years ago
Ion Bazan a2137d5263 use Symfony PHPUnit Bridge 4 years ago
Nils Adermann 5bdc0fc9c5 Request jobs replaced by root require / fixed package
The only type of request job remaining was "install" which is really a
root requirement. The only other kind of input for the solver is now a
set of fixed packages.

Rules have been updated to account for only two kinds of former job
reason: FIXED or ROOT_REQUIRE. The job property has always been
redundant and has been removed, since reasonData suffices.

Problem reasons are always rules, so the unnecessary wrapping in an
array has been removed.

We now only ever generate a single rule per root require or fixed
package, so there is no need for the solver to special handle disabling
"jobs" anymore, the rule can just be disabled as usual.

For consistency special handling of rules for jobs in problems has been
integrated into the rule class like all other rule reasons. As part of
this change the error message for root requirements has been improved a
bit to make it clearer where the package installation request came from.

The word job has also been removed from operations, which are called
operations, not jobs.
5 years ago
Yanick Witschi 02b6dc876f Fixed phpstan issues 5 years ago
Nils Adermann 1228bcdffc Internalize pool creation in repository set, store root aliases in set
The pool is still exposed too early in a few places which will require
further refactoring
6 years ago
Gabriel Caruso 3d262bd637 Fixes from PHPStan level 0
More fixes from PHPStan level 0
7 years ago
Gabriel Caruso afc9a7643e Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase 7 years ago
rubenrua 4e1887a721 Improve memory usage resolving dependencies
It is known that composer update takes a lot of memory: #5915, #5902,

I am playing with a profiler (@blackfireio) to make a demo in my local
PHP meetup (@phpvigo) and I found out a way to use less memory. These
are my first tests:

* Private project using PHP 5.6:
  * Memory: from 1.31GB to 1.07GB
  * Wall Time: from 2min 8s to 1min 33s

* symfony-demo using PHP 7.1 in my old mac book:
  * Memory: from 667MB to 523MB
  * Wall Time: from  5min 29s to 5min 28s

Not use an array inside conflict rules is this improvement main idea:

```php
<?php
//Memory 38MB
gc_collect_cycles();
gc_disable();

class Rule
{
    public $literals;

    public function __construct(array $literals)
    {
        $this->literals = $literals;
    }
}

$rules = array();

$i = 0;
while ($i<80000){ //
    $i++;

    $array = array(-$i, $i);
    $rule = new Rule($array);
    $rules[] = $rule;
}
```

```php
<?php
//Memory 11.1MB
gc_collect_cycles();
gc_disable();

class Rule2Literals
{
    public $literal1;
    public $literal2;

    public function __construct($literal1, $literal2)
    {
        $this->literal1 = $literal1;
        $this->literal2 = $literal2;
    }
}

$rules = array();

$i = 0;
while ($i<80000){ //
    $i++;

    $rule = new ConflictRule(-$i, $i);
    $rules[] = $rule;
}
```

More info https://github.com/composer/composer/pull/6168
7 years ago
Jordi Boggiano c74e6df65d Fix strings being passed to an int arg, fixes 7.1 build 8 years ago
Nils Adermann 26598c4a9a Remove unnecessary pool reference from rules 10 years ago
Jordi Boggiano 3ca22f9ef1 Fix class name 12 years ago
Nils Adermann 451bab1c2c Get rid of Literal object / literal id mix, use literals only to save memory 12 years ago
Nils Adermann 15f43571b9 Rules of type feature are no longer needed 12 years ago
Jordi Boggiano f7440076fa Revert "Merge remote-tracking branch 'naderman/remove-packages-by-default'"
This reverts commit 2988152602, reversing
changes made to adb4188e12.
12 years ago
Nils Adermann f4d5568937 Rules of type feature are no longer needed 12 years ago
Volker Dusch 3fb75faa75 Now that no more update rules are created the code that handles them can be removed too.
Also adapted the tests that used TYPE_UPDATE exemplarily to use TYPE_FEATURE.
13 years ago
Leszek Prabucki f59ca1e2f8 Made fixes after review. 13 years ago
Leszek Prabucki de7f666118 Added and extended some unit tests 13 years ago
Nils Adermann bc672deb32 Moving rule iteration logic to a separate RuleSet and RuleSetIterator class 13 years ago