Skip to content

Commit 0a24562

Browse files
committed
testing benchmarks
1 parent a780330 commit 0a24562

File tree

3 files changed

+37
-34
lines changed

3 files changed

+37
-34
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ script:
4747
php -d 'zend.assertions=1' vendor/bin/phpunit --verbose;
4848
fi
4949

50+
# run benchmarks to make sure they are working fine
51+
- php vendor/bin/phpbench run --no-interaction --revs=1 --retry-threshold=100
52+
5053
after_script:
5154
- if [ "${CODE_COVERAGE}" == "1" ]; then
5255
php ocular.phar code-coverage:upload --format=php-clover coverage.clover;

bench/EnumSet32Bench.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,97 +54,97 @@ public function init()
5454
public function benchAttachEnumerator()
5555
{
5656
foreach ($this->enumerators as $enumerator) {
57-
$this->emptySet->attachEnumerator($enumerator);
57+
$this->emptySet->add($enumerator);
5858
}
5959
}
6060

6161
public function benchWithEnumerator()
6262
{
6363
foreach ($this->enumerators as $enumerator) {
64-
$this->emptySet->withEnumerator($enumerator);
64+
$this->emptySet->with($enumerator);
6565
}
6666
}
6767

6868
public function benchAttachEnumerators()
6969
{
70-
$this->emptySet->withEnumerators($this->enumerators);
70+
$this->emptySet->withIterable($this->enumerators);
7171
}
7272

7373
public function benchWithEnumerators()
7474
{
75-
$this->emptySet->attachEnumerators($this->enumerators);
75+
$this->emptySet->addIterable($this->enumerators);
7676
}
7777

7878
public function benchWithValue()
7979
{
8080
foreach ($this->values as $value) {
81-
$this->emptySet->withEnumerator($value);
81+
$this->emptySet->with($value);
8282
}
8383
}
8484

8585
public function benchAttachValue()
8686
{
8787
foreach ($this->values as $value) {
88-
$this->emptySet->attachEnumerator($value);
88+
$this->emptySet->add($value);
8989
}
9090
}
9191

9292
public function benchAttachValues()
9393
{
94-
$this->emptySet->attachEnumerators($this->values);
94+
$this->emptySet->addIterable($this->values);
9595
}
9696

9797
public function benchWithValues()
9898
{
99-
$this->emptySet->withEnumerators($this->values);
99+
$this->emptySet->withIterable($this->values);
100100
}
101101

102102
public function benchDetachEnumerator()
103103
{
104104
foreach ($this->enumerators as $enumerator) {
105-
$this->fullSet->detachEnumerator($enumerator);
105+
$this->fullSet->remove($enumerator);
106106
}
107107
}
108108

109109
public function benchWithoutEnumerator()
110110
{
111111
foreach ($this->enumerators as $enumerator) {
112-
$this->fullSet->withoutEnumerator($enumerator);
112+
$this->fullSet->without($enumerator);
113113
}
114114
}
115115

116116
public function benchDetachEnumerators()
117117
{
118-
$this->fullSet->detachEnumerators($this->enumerators);
118+
$this->fullSet->removeIterable($this->enumerators);
119119
}
120120

121121
public function benchWithoutEnumerators()
122122
{
123-
$this->fullSet->withoutEnumerators($this->enumerators);
123+
$this->fullSet->withoutIterable($this->enumerators);
124124
}
125125

126126
public function benchDetachValue()
127127
{
128128
foreach ($this->values as $value) {
129-
$this->fullSet->detachEnumerator($value);
129+
$this->fullSet->remove($value);
130130
}
131131
}
132132

133133
public function benchWithoutValue()
134134
{
135135
foreach ($this->values as $value) {
136-
$this->fullSet->withoutEnumerator($value);
136+
$this->fullSet->without($value);
137137
}
138138
}
139139

140140
public function benchDetachValues()
141141
{
142-
$this->fullSet->detachEnumerators($this->values);
142+
$this->fullSet->removeIterable($this->values);
143143
}
144144

145145
public function benchWithoutValues()
146146
{
147-
$this->fullSet->withoutEnumerators($this->values);
147+
$this->fullSet->withoutIterable($this->values);
148148
}
149149

150150
public function benchContainsEnumerator()

bench/EnumSet66Bench.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,100 +51,100 @@ public function init()
5151
$this->fullSet = new EnumSet(Enum66::class, $this->enumerators);
5252
}
5353

54-
public function benchAttachEnumerator()
54+
public function benchAddEnumerator()
5555
{
5656
foreach ($this->enumerators as $enumerator) {
57-
$this->emptySet->attachEnumerator($enumerator);
57+
$this->emptySet->add($enumerator);
5858
}
5959
}
6060

6161
public function benchWithEnumerator()
6262
{
6363
foreach ($this->enumerators as $enumerator) {
64-
$this->emptySet->withEnumerator($enumerator);
64+
$this->emptySet->with($enumerator);
6565
}
6666
}
6767

68-
public function benchAttachEnumerators()
68+
public function benchAddIterableEnumerators()
6969
{
70-
$this->emptySet->attachEnumerators($this->enumerators);
70+
$this->emptySet->addIterable($this->enumerators);
7171
}
7272

7373
public function benchWithEnumerators()
7474
{
75-
$this->emptySet->withEnumerators($this->enumerators);
75+
$this->emptySet->withIterable($this->enumerators);
7676
}
7777

7878
public function benchAttachValue()
7979
{
8080
foreach ($this->values as $value) {
81-
$this->emptySet->attachEnumerator($value);
81+
$this->emptySet->add($value);
8282
}
8383
}
8484

8585
public function benchWithValue()
8686
{
8787
foreach ($this->values as $value) {
88-
$this->emptySet->withEnumerator($value);
88+
$this->emptySet->with($value);
8989
}
9090
}
9191

9292
public function benchAttachValues()
9393
{
94-
$this->emptySet->attachEnumerators($this->values);
94+
$this->emptySet->addIterable($this->values);
9595
}
9696

9797
public function benchWithValues()
9898
{
99-
$this->emptySet->withEnumerators($this->values);
99+
$this->emptySet->withIterable($this->values);
100100
}
101101

102102
public function benchDetachEnumerator()
103103
{
104104
foreach ($this->enumerators as $enumerator) {
105-
$this->emptySet->detachEnumerator($enumerator);
105+
$this->emptySet->remove($enumerator);
106106
}
107107
}
108108

109109
public function benchWithoutEnumerator()
110110
{
111111
foreach ($this->enumerators as $enumerator) {
112-
$this->emptySet->withoutEnumerator($enumerator);
112+
$this->emptySet->without($enumerator);
113113
}
114114
}
115115

116116
public function benchDetachEnumerators()
117117
{
118-
$this->emptySet->detachEnumerators($this->enumerators);
118+
$this->emptySet->removeIterable($this->enumerators);
119119
}
120120

121121
public function benchWithoutEnumerators()
122122
{
123-
$this->emptySet->withoutEnumerators($this->enumerators);
123+
$this->emptySet->withoutIterable($this->enumerators);
124124
}
125125

126126
public function benchDetachValue()
127127
{
128128
foreach ($this->values as $value) {
129-
$this->emptySet->detachEnumerator($value);
129+
$this->emptySet->remove($value);
130130
}
131131
}
132132

133133
public function benchWithoutValue()
134134
{
135135
foreach ($this->values as $value) {
136-
$this->emptySet->withoutEnumerator($value);
136+
$this->emptySet->without($value);
137137
}
138138
}
139139

140140
public function benchDetachValues()
141141
{
142-
$this->emptySet->detachEnumerators($this->values);
142+
$this->emptySet->removeIterable($this->values);
143143
}
144144

145145
public function benchWithoutValues()
146146
{
147-
$this->emptySet->withoutEnumerators($this->values);
147+
$this->emptySet->withoutIterable($this->values);
148148
}
149149

150150
public function benchContainsEnumerator()

0 commit comments

Comments
 (0)