Repository navigation
Commit e104be4
committed
Reduce array_diff() long fast path overhead
Check the first value's type inline before calling php_array_diff_long(),
and scan the exclude arrays before the first array so sparse or non-int
exclusions fall back without a full scan of the first array. Allocate the
bitset with ZEND_BITSET_ALLOCA like the other bitsets in this file. Add a
test building a bitset of more than one word, a NEWS entry, and clarify
that only the values to exclude need to be dense.
Suggested by @ArtUkrainskiy.1 parent 0d9e757 commit e104be4
4 files changed
Lines changed: 39 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
128 | 130 | | |
129 | 131 | | |
130 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | | - | |
| 110 | + | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6072 | 6072 | | |
6073 | 6073 | | |
6074 | 6074 | | |
| 6075 | + | |
| 6076 | + | |
| 6077 | + | |
| 6078 | + | |
| 6079 | + | |
| 6080 | + | |
| 6081 | + | |
| 6082 | + | |
| 6083 | + | |
| 6084 | + | |
| 6085 | + | |
| 6086 | + | |
6075 | 6087 | | |
6076 | 6088 | | |
6077 | 6089 | | |
| |||
6082 | 6094 | | |
6083 | 6095 | | |
6084 | 6096 | | |
6085 | | - | |
6086 | | - | |
6087 | | - | |
6088 | | - | |
6089 | | - | |
6090 | | - | |
| 6097 | + | |
6091 | 6098 | | |
6092 | 6099 | | |
6093 | 6100 | | |
| |||
6111 | 6118 | | |
6112 | 6119 | | |
6113 | 6120 | | |
| 6121 | + | |
| 6122 | + | |
| 6123 | + | |
| 6124 | + | |
| 6125 | + | |
| 6126 | + | |
| 6127 | + | |
6114 | 6128 | | |
6115 | 6129 | | |
6116 | | - | |
| 6130 | + | |
6117 | 6131 | | |
6118 | 6132 | | |
6119 | 6133 | | |
| |||
6140 | 6154 | | |
6141 | 6155 | | |
6142 | 6156 | | |
6143 | | - | |
| 6157 | + | |
6144 | 6158 | | |
6145 | 6159 | | |
6146 | 6160 | | |
| |||
6244 | 6258 | | |
6245 | 6259 | | |
6246 | 6260 | | |
6247 | | - | |
| 6261 | + | |
| 6262 | + | |
6248 | 6263 | | |
6249 | 6264 | | |
6250 | 6265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
46 | 56 | | |
47 | 57 | | |
48 | 58 | | |
| |||
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
| 74 | + | |
0 commit comments