roaringbitmap 0.7.2__tar.gz → 0.7.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,30 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: roaringbitmap
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: Roaring Bitmap
5
5
  Home-page: http://roaringbitmap.readthedocs.io
6
6
  Author: Andreas van Cranenburgh
7
7
  Author-email: A.W.van.Cranenburgh@rug.nl
8
- License: GPL
8
+ License: GPL-2.0-or-later
9
9
  Platform: Many
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Intended Audience :: Science/Research
12
- Classifier: License :: OSI Approved :: GNU General Public License (GPL)
13
12
  Classifier: Operating System :: POSIX
14
13
  Classifier: Programming Language :: Python :: 2.7
15
14
  Classifier: Programming Language :: Python :: 3.3
16
15
  Classifier: Programming Language :: Cython
16
+ Description-Content-Type: text/x-rst
17
17
  License-File: LICENSE
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: license
25
+ Dynamic: license-file
26
+ Dynamic: platform
27
+ Dynamic: summary
18
28
 
19
29
  Roaring Bitmap in Cython
20
30
  ========================
@@ -54,18 +64,37 @@ License, requirements
54
64
  The code is licensed under GNU GPL v2, or any later version at your option.
55
65
 
56
66
  - Python 2.7+/3.3+ http://www.python.org (headers required, e.g. python-dev package)
57
- - Cython 0.20+ http://www.cython.org
67
+ - Cython 3.0+ http://www.cython.org
58
68
 
59
- Installation, usage
60
- -------------------
69
+ Installation
70
+ ------------
61
71
 
72
+ ::
73
+ $ pip install roaringbitmap
74
+
75
+ For Linux and Mac, there are binary wheels. Binary wheels for x86-64 require
76
+ the POPCNT CPU instruction and raise ``ImportError`` on unsupported CPUs.
77
+ Builds from source use ``-march=native`` by default and are optimized for the
78
+ build machine.
79
+
80
+ To compile from source:
62
81
  ::
63
82
 
64
83
  $ git clone https://github.com/andreasvc/roaringbitmap.git
65
84
  $ cd roaringbitmap
66
85
  $ make
67
86
 
68
- (or ``make py2`` for Python 2)
87
+ For Python 2, build with a Cython version that supports Python 2.7::
88
+
89
+ $ python2 -m pip install 'Cython>=3,<3.1'
90
+ $ make py2
91
+
92
+ The C sources published on PyPI are generated with the current Cython release
93
+ and support Python 3 only.
94
+
95
+
96
+ Usage
97
+ -----
69
98
 
70
99
  A ``RoaringBitmap()`` can be used as a replacement for a normal (mutable)
71
100
  Python set containing (unsigned) 32-bit integers:
@@ -99,54 +128,63 @@ Output of ``$ make bench``::
99
128
 
100
129
  small sparse set
101
130
  100 runs with sets of 200 random elements n s.t. 0 <= n < 40000
102
- set() RoaringBitmap() ratio
103
- init 0.000834 0.00138 0.603
104
- initsort 0.00085 0.000394 2.16
105
- and 0.00102 8.49e-05 12.1
106
- or 0.00171 0.000169 10.1
107
- xor 0.00152 0.000213 7.11
108
- sub 0.000934 0.000197 4.74
109
- iand 1.29e-05 2.97e-06 4.35
110
- ior 9.7e-06 3.26e-06 2.98
111
- ixor 8.98e-06 3.43e-06 2.62
112
- isub 6.83e-06 3.3e-06 2.07
113
- eq 0.000438 1.17e-05 37.6
114
- neq 6.37e-06 7.81e-06 0.816
115
- jaccard 0.0029 0.000126 23.1
131
+ set() RoaringBitmap() ratio
132
+ init 0.000383 0.000627 0.61
133
+ initsort 0.000992 0.000258 3.85
134
+ and 0.000499 0.000125 3.98
135
+ or 0.000507 8.9e-05 5.7
136
+ xor 0.000479 8.14e-05 5.88
137
+ sub 0.000335 7.57e-05 4.42
138
+ iand 1.18e-05 2.77e-06 4.26
139
+ ior 8.39e-06 2.75e-06 3.05
140
+ ixor 8.12e-06 2.81e-06 2.89
141
+ isub 6.54e-06 2.87e-06 2.28
142
+ eq_identity 0.000183 4.78e-06 38.2
143
+ eq_equal 0.000169 7.33e-06 23
144
+ neq_card 4.62e-06 5.43e-06 0.85
145
+ neq_early 1.79e-05 6.21e-06 2.89
146
+ neq_late 0.000167 6.64e-06 25.2
147
+ jaccard 0.000973 4.99e-05 19.5
116
148
 
117
149
  medium load factor
118
150
  100 runs with sets of 59392 random elements n s.t. 0 <= n < 118784
119
- set() RoaringBitmap() ratio
120
- init 0.564 0.324 1.74
121
- initsort 0.696 0.273 2.55
122
- and 0.613 0.000418 1466
123
- or 0.976 0.000292 3344
124
- xor 0.955 0.000294 3250
125
- sub 0.346 0.000316 1092
126
- iand 0.00658 1.14e-05 575
127
- ior 0.00594 1.08e-05 548
128
- ixor 0.00434 1.12e-05 385
129
- isub 0.00431 1.09e-05 397
130
- eq 0.0991 0.000116 851
131
- neq 9.62e-06 1.29e-05 0.743
132
- jaccard 1.62 0.00025 6476
151
+ set() RoaringBitmap() ratio
152
+ init 0.451 0.138 3.26
153
+ initsort 0.349 0.0995 3.51
154
+ and 0.362 0.000271 1336
155
+ or 0.482 0.000248 1942
156
+ xor 0.46 0.000258 1780
157
+ sub 0.381 0.000444 857
158
+ iand 0.00421 5.33e-06 790
159
+ ior 0.00581 5.49e-06 1058
160
+ ixor 0.00243 5.05e-06 481
161
+ isub 0.00229 4.88e-06 469
162
+ eq_identity 0.123 1.64e-05 7501
163
+ eq_equal 0.137 3.75e-05 3643
164
+ neq_card 7.49e-06 7.06e-06 1.06
165
+ neq_early 8.08e-06 2.22e-05 0.364
166
+ neq_late 0.139 5.42e-05 2571
167
+ jaccard 0.88 0.000183 4806
133
168
 
134
169
  dense set / high load factor
135
170
  100 runs with sets of 39800 random elements n s.t. 0 <= n < 40000
136
- set() RoaringBitmap() ratio
137
- init 0.33 0.0775 4.26
138
- initsort 0.352 0.148 2.38
139
- and 0.24 0.000223 1078
140
- or 0.45 0.000165 2734
141
- xor 0.404 0.000161 2514
142
- sub 0.169 0.000173 973
143
- iand 0.00287 6.02e-06 477
144
- ior 0.00179 6.34e-06 282
145
- ixor 0.00195 5.53e-06 353
146
- isub 0.0017 6.35e-06 267
147
- eq 0.0486 4.65e-05 1045
148
- neq 1.01e-05 1.13e-05 0.888
149
- jaccard 0.722 0.000118 6136
171
+ set() RoaringBitmap() ratio
172
+ init 0.206 0.0967 2.13
173
+ initsort 0.179 0.0531 3.37
174
+ and 0.149 0.000134 1117
175
+ or 0.209 0.000112 1862
176
+ xor 0.186 0.000112 1653
177
+ sub 0.12 0.000109 1092
178
+ iand 0.00174 3.75e-06 463
179
+ ior 0.000865 3.58e-06 241
180
+ ixor 0.00112 3.6e-06 310
181
+ isub 0.00102 3.5e-06 292
182
+ eq_identity 0.052 5.39e-06 9644
183
+ eq_equal 0.0559 1.68e-05 3318
184
+ neq_card 7.18e-06 7.53e-06 0.954
185
+ neq_early 7.17e-06 7.73e-06 0.928
186
+ neq_late 0.0437 1.36e-05 3209
187
+ jaccard 0.342 9.84e-05 3472
150
188
 
151
189
  See https://github.com/Ezibenroc/roaring_analysis/ for a performance comparison
152
190
  of PyRoaringBitmap and this library.
@@ -36,18 +36,37 @@ License, requirements
36
36
  The code is licensed under GNU GPL v2, or any later version at your option.
37
37
 
38
38
  - Python 2.7+/3.3+ http://www.python.org (headers required, e.g. python-dev package)
39
- - Cython 0.20+ http://www.cython.org
39
+ - Cython 3.0+ http://www.cython.org
40
40
 
41
- Installation, usage
42
- -------------------
41
+ Installation
42
+ ------------
43
43
 
44
+ ::
45
+ $ pip install roaringbitmap
46
+
47
+ For Linux and Mac, there are binary wheels. Binary wheels for x86-64 require
48
+ the POPCNT CPU instruction and raise ``ImportError`` on unsupported CPUs.
49
+ Builds from source use ``-march=native`` by default and are optimized for the
50
+ build machine.
51
+
52
+ To compile from source:
44
53
  ::
45
54
 
46
55
  $ git clone https://github.com/andreasvc/roaringbitmap.git
47
56
  $ cd roaringbitmap
48
57
  $ make
49
58
 
50
- (or ``make py2`` for Python 2)
59
+ For Python 2, build with a Cython version that supports Python 2.7::
60
+
61
+ $ python2 -m pip install 'Cython>=3,<3.1'
62
+ $ make py2
63
+
64
+ The C sources published on PyPI are generated with the current Cython release
65
+ and support Python 3 only.
66
+
67
+
68
+ Usage
69
+ -----
51
70
 
52
71
  A ``RoaringBitmap()`` can be used as a replacement for a normal (mutable)
53
72
  Python set containing (unsigned) 32-bit integers:
@@ -81,54 +100,63 @@ Output of ``$ make bench``::
81
100
 
82
101
  small sparse set
83
102
  100 runs with sets of 200 random elements n s.t. 0 <= n < 40000
84
- set() RoaringBitmap() ratio
85
- init 0.000834 0.00138 0.603
86
- initsort 0.00085 0.000394 2.16
87
- and 0.00102 8.49e-05 12.1
88
- or 0.00171 0.000169 10.1
89
- xor 0.00152 0.000213 7.11
90
- sub 0.000934 0.000197 4.74
91
- iand 1.29e-05 2.97e-06 4.35
92
- ior 9.7e-06 3.26e-06 2.98
93
- ixor 8.98e-06 3.43e-06 2.62
94
- isub 6.83e-06 3.3e-06 2.07
95
- eq 0.000438 1.17e-05 37.6
96
- neq 6.37e-06 7.81e-06 0.816
97
- jaccard 0.0029 0.000126 23.1
103
+ set() RoaringBitmap() ratio
104
+ init 0.000383 0.000627 0.61
105
+ initsort 0.000992 0.000258 3.85
106
+ and 0.000499 0.000125 3.98
107
+ or 0.000507 8.9e-05 5.7
108
+ xor 0.000479 8.14e-05 5.88
109
+ sub 0.000335 7.57e-05 4.42
110
+ iand 1.18e-05 2.77e-06 4.26
111
+ ior 8.39e-06 2.75e-06 3.05
112
+ ixor 8.12e-06 2.81e-06 2.89
113
+ isub 6.54e-06 2.87e-06 2.28
114
+ eq_identity 0.000183 4.78e-06 38.2
115
+ eq_equal 0.000169 7.33e-06 23
116
+ neq_card 4.62e-06 5.43e-06 0.85
117
+ neq_early 1.79e-05 6.21e-06 2.89
118
+ neq_late 0.000167 6.64e-06 25.2
119
+ jaccard 0.000973 4.99e-05 19.5
98
120
 
99
121
  medium load factor
100
122
  100 runs with sets of 59392 random elements n s.t. 0 <= n < 118784
101
- set() RoaringBitmap() ratio
102
- init 0.564 0.324 1.74
103
- initsort 0.696 0.273 2.55
104
- and 0.613 0.000418 1466
105
- or 0.976 0.000292 3344
106
- xor 0.955 0.000294 3250
107
- sub 0.346 0.000316 1092
108
- iand 0.00658 1.14e-05 575
109
- ior 0.00594 1.08e-05 548
110
- ixor 0.00434 1.12e-05 385
111
- isub 0.00431 1.09e-05 397
112
- eq 0.0991 0.000116 851
113
- neq 9.62e-06 1.29e-05 0.743
114
- jaccard 1.62 0.00025 6476
123
+ set() RoaringBitmap() ratio
124
+ init 0.451 0.138 3.26
125
+ initsort 0.349 0.0995 3.51
126
+ and 0.362 0.000271 1336
127
+ or 0.482 0.000248 1942
128
+ xor 0.46 0.000258 1780
129
+ sub 0.381 0.000444 857
130
+ iand 0.00421 5.33e-06 790
131
+ ior 0.00581 5.49e-06 1058
132
+ ixor 0.00243 5.05e-06 481
133
+ isub 0.00229 4.88e-06 469
134
+ eq_identity 0.123 1.64e-05 7501
135
+ eq_equal 0.137 3.75e-05 3643
136
+ neq_card 7.49e-06 7.06e-06 1.06
137
+ neq_early 8.08e-06 2.22e-05 0.364
138
+ neq_late 0.139 5.42e-05 2571
139
+ jaccard 0.88 0.000183 4806
115
140
 
116
141
  dense set / high load factor
117
142
  100 runs with sets of 39800 random elements n s.t. 0 <= n < 40000
118
- set() RoaringBitmap() ratio
119
- init 0.33 0.0775 4.26
120
- initsort 0.352 0.148 2.38
121
- and 0.24 0.000223 1078
122
- or 0.45 0.000165 2734
123
- xor 0.404 0.000161 2514
124
- sub 0.169 0.000173 973
125
- iand 0.00287 6.02e-06 477
126
- ior 0.00179 6.34e-06 282
127
- ixor 0.00195 5.53e-06 353
128
- isub 0.0017 6.35e-06 267
129
- eq 0.0486 4.65e-05 1045
130
- neq 1.01e-05 1.13e-05 0.888
131
- jaccard 0.722 0.000118 6136
143
+ set() RoaringBitmap() ratio
144
+ init 0.206 0.0967 2.13
145
+ initsort 0.179 0.0531 3.37
146
+ and 0.149 0.000134 1117
147
+ or 0.209 0.000112 1862
148
+ xor 0.186 0.000112 1653
149
+ sub 0.12 0.000109 1092
150
+ iand 0.00174 3.75e-06 463
151
+ ior 0.000865 3.58e-06 241
152
+ ixor 0.00112 3.6e-06 310
153
+ isub 0.00102 3.5e-06 292
154
+ eq_identity 0.052 5.39e-06 9644
155
+ eq_equal 0.0559 1.68e-05 3318
156
+ neq_card 7.18e-06 7.53e-06 0.954
157
+ neq_early 7.17e-06 7.73e-06 0.928
158
+ neq_late 0.0437 1.36e-05 3209
159
+ jaccard 0.342 9.84e-05 3472
132
160
 
133
161
  See https://github.com/Ezibenroc/roaring_analysis/ for a performance comparison
134
162
  of PyRoaringBitmap and this library.
@@ -0,0 +1,22 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools<45; python_version < '3'",
4
+ "setuptools>=61; python_version >= '3'",
5
+ "Cython>=3,<3.1; python_version < '3'",
6
+ "Cython>=3; python_version >= '3'",
7
+ ]
8
+ build-backend = "setuptools.build_meta"
9
+
10
+ [dependency-groups]
11
+ dev = [
12
+ "pytest>=3.0.0",
13
+ "pycodestyle",
14
+ ]
15
+
16
+ [tool.cibuildwheel]
17
+ build = "cp311-* cp312-* cp313-* cp314-* cp315-*"
18
+ skip = "*-musllinux_*"
19
+ build-verbosity = 1
20
+ environment = { ROARINGBITMAP_BUILD_WHEEL = "1" }
21
+ test-requires = "pytest"
22
+ test-command = "python -m pytest {project}/tests/unittests.py"
@@ -1,20 +1,30 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: roaringbitmap
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: Roaring Bitmap
5
5
  Home-page: http://roaringbitmap.readthedocs.io
6
6
  Author: Andreas van Cranenburgh
7
7
  Author-email: A.W.van.Cranenburgh@rug.nl
8
- License: GPL
8
+ License: GPL-2.0-or-later
9
9
  Platform: Many
10
10
  Classifier: Development Status :: 4 - Beta
11
11
  Classifier: Intended Audience :: Science/Research
12
- Classifier: License :: OSI Approved :: GNU General Public License (GPL)
13
12
  Classifier: Operating System :: POSIX
14
13
  Classifier: Programming Language :: Python :: 2.7
15
14
  Classifier: Programming Language :: Python :: 3.3
16
15
  Classifier: Programming Language :: Cython
16
+ Description-Content-Type: text/x-rst
17
17
  License-File: LICENSE
18
+ Dynamic: author
19
+ Dynamic: author-email
20
+ Dynamic: classifier
21
+ Dynamic: description
22
+ Dynamic: description-content-type
23
+ Dynamic: home-page
24
+ Dynamic: license
25
+ Dynamic: license-file
26
+ Dynamic: platform
27
+ Dynamic: summary
18
28
 
19
29
  Roaring Bitmap in Cython
20
30
  ========================
@@ -54,18 +64,37 @@ License, requirements
54
64
  The code is licensed under GNU GPL v2, or any later version at your option.
55
65
 
56
66
  - Python 2.7+/3.3+ http://www.python.org (headers required, e.g. python-dev package)
57
- - Cython 0.20+ http://www.cython.org
67
+ - Cython 3.0+ http://www.cython.org
58
68
 
59
- Installation, usage
60
- -------------------
69
+ Installation
70
+ ------------
61
71
 
72
+ ::
73
+ $ pip install roaringbitmap
74
+
75
+ For Linux and Mac, there are binary wheels. Binary wheels for x86-64 require
76
+ the POPCNT CPU instruction and raise ``ImportError`` on unsupported CPUs.
77
+ Builds from source use ``-march=native`` by default and are optimized for the
78
+ build machine.
79
+
80
+ To compile from source:
62
81
  ::
63
82
 
64
83
  $ git clone https://github.com/andreasvc/roaringbitmap.git
65
84
  $ cd roaringbitmap
66
85
  $ make
67
86
 
68
- (or ``make py2`` for Python 2)
87
+ For Python 2, build with a Cython version that supports Python 2.7::
88
+
89
+ $ python2 -m pip install 'Cython>=3,<3.1'
90
+ $ make py2
91
+
92
+ The C sources published on PyPI are generated with the current Cython release
93
+ and support Python 3 only.
94
+
95
+
96
+ Usage
97
+ -----
69
98
 
70
99
  A ``RoaringBitmap()`` can be used as a replacement for a normal (mutable)
71
100
  Python set containing (unsigned) 32-bit integers:
@@ -99,54 +128,63 @@ Output of ``$ make bench``::
99
128
 
100
129
  small sparse set
101
130
  100 runs with sets of 200 random elements n s.t. 0 <= n < 40000
102
- set() RoaringBitmap() ratio
103
- init 0.000834 0.00138 0.603
104
- initsort 0.00085 0.000394 2.16
105
- and 0.00102 8.49e-05 12.1
106
- or 0.00171 0.000169 10.1
107
- xor 0.00152 0.000213 7.11
108
- sub 0.000934 0.000197 4.74
109
- iand 1.29e-05 2.97e-06 4.35
110
- ior 9.7e-06 3.26e-06 2.98
111
- ixor 8.98e-06 3.43e-06 2.62
112
- isub 6.83e-06 3.3e-06 2.07
113
- eq 0.000438 1.17e-05 37.6
114
- neq 6.37e-06 7.81e-06 0.816
115
- jaccard 0.0029 0.000126 23.1
131
+ set() RoaringBitmap() ratio
132
+ init 0.000383 0.000627 0.61
133
+ initsort 0.000992 0.000258 3.85
134
+ and 0.000499 0.000125 3.98
135
+ or 0.000507 8.9e-05 5.7
136
+ xor 0.000479 8.14e-05 5.88
137
+ sub 0.000335 7.57e-05 4.42
138
+ iand 1.18e-05 2.77e-06 4.26
139
+ ior 8.39e-06 2.75e-06 3.05
140
+ ixor 8.12e-06 2.81e-06 2.89
141
+ isub 6.54e-06 2.87e-06 2.28
142
+ eq_identity 0.000183 4.78e-06 38.2
143
+ eq_equal 0.000169 7.33e-06 23
144
+ neq_card 4.62e-06 5.43e-06 0.85
145
+ neq_early 1.79e-05 6.21e-06 2.89
146
+ neq_late 0.000167 6.64e-06 25.2
147
+ jaccard 0.000973 4.99e-05 19.5
116
148
 
117
149
  medium load factor
118
150
  100 runs with sets of 59392 random elements n s.t. 0 <= n < 118784
119
- set() RoaringBitmap() ratio
120
- init 0.564 0.324 1.74
121
- initsort 0.696 0.273 2.55
122
- and 0.613 0.000418 1466
123
- or 0.976 0.000292 3344
124
- xor 0.955 0.000294 3250
125
- sub 0.346 0.000316 1092
126
- iand 0.00658 1.14e-05 575
127
- ior 0.00594 1.08e-05 548
128
- ixor 0.00434 1.12e-05 385
129
- isub 0.00431 1.09e-05 397
130
- eq 0.0991 0.000116 851
131
- neq 9.62e-06 1.29e-05 0.743
132
- jaccard 1.62 0.00025 6476
151
+ set() RoaringBitmap() ratio
152
+ init 0.451 0.138 3.26
153
+ initsort 0.349 0.0995 3.51
154
+ and 0.362 0.000271 1336
155
+ or 0.482 0.000248 1942
156
+ xor 0.46 0.000258 1780
157
+ sub 0.381 0.000444 857
158
+ iand 0.00421 5.33e-06 790
159
+ ior 0.00581 5.49e-06 1058
160
+ ixor 0.00243 5.05e-06 481
161
+ isub 0.00229 4.88e-06 469
162
+ eq_identity 0.123 1.64e-05 7501
163
+ eq_equal 0.137 3.75e-05 3643
164
+ neq_card 7.49e-06 7.06e-06 1.06
165
+ neq_early 8.08e-06 2.22e-05 0.364
166
+ neq_late 0.139 5.42e-05 2571
167
+ jaccard 0.88 0.000183 4806
133
168
 
134
169
  dense set / high load factor
135
170
  100 runs with sets of 39800 random elements n s.t. 0 <= n < 40000
136
- set() RoaringBitmap() ratio
137
- init 0.33 0.0775 4.26
138
- initsort 0.352 0.148 2.38
139
- and 0.24 0.000223 1078
140
- or 0.45 0.000165 2734
141
- xor 0.404 0.000161 2514
142
- sub 0.169 0.000173 973
143
- iand 0.00287 6.02e-06 477
144
- ior 0.00179 6.34e-06 282
145
- ixor 0.00195 5.53e-06 353
146
- isub 0.0017 6.35e-06 267
147
- eq 0.0486 4.65e-05 1045
148
- neq 1.01e-05 1.13e-05 0.888
149
- jaccard 0.722 0.000118 6136
171
+ set() RoaringBitmap() ratio
172
+ init 0.206 0.0967 2.13
173
+ initsort 0.179 0.0531 3.37
174
+ and 0.149 0.000134 1117
175
+ or 0.209 0.000112 1862
176
+ xor 0.186 0.000112 1653
177
+ sub 0.12 0.000109 1092
178
+ iand 0.00174 3.75e-06 463
179
+ ior 0.000865 3.58e-06 241
180
+ ixor 0.00112 3.6e-06 310
181
+ isub 0.00102 3.5e-06 292
182
+ eq_identity 0.052 5.39e-06 9644
183
+ eq_equal 0.0559 1.68e-05 3318
184
+ neq_card 7.18e-06 7.53e-06 0.954
185
+ neq_early 7.17e-06 7.73e-06 0.928
186
+ neq_late 0.0437 1.36e-05 3209
187
+ jaccard 0.342 9.84e-05 3472
150
188
 
151
189
  See https://github.com/Ezibenroc/roaring_analysis/ for a performance comparison
152
190
  of PyRoaringBitmap and this library.
@@ -1,6 +1,7 @@
1
1
  LICENSE
2
2
  MANIFEST.in
3
3
  README.rst
4
+ pyproject.toml
4
5
  setup.py
5
6
  roaringbitmap.egg-info/PKG-INFO
6
7
  roaringbitmap.egg-info/SOURCES.txt
@@ -8,5 +9,6 @@ roaringbitmap.egg-info/dependency_links.txt
8
9
  roaringbitmap.egg-info/top_level.txt
9
10
  src/_arrayops.h
10
11
  src/bitcount.h
12
+ src/cpu_features.h
11
13
  src/macros.h
12
14
  src/roaringbitmap.c
@@ -1,8 +1,8 @@
1
1
  """Generic setup.py for Cython code."""
2
2
  import os
3
+ import platform
3
4
  import sys
4
- from distutils.core import setup
5
- from distutils.extension import Extension
5
+ from setuptools import Extension, setup
6
6
 
7
7
  PY2 = sys.version_info[0] == 2
8
8
 
@@ -29,22 +29,27 @@ MTUNE = '--with-mtune' in sys.argv
29
29
  if MTUNE:
30
30
  sys.argv.remove('--with-mtune')
31
31
 
32
+ # Release wheels must not inherit all instruction sets from the CI host. The
33
+ # x86-64 wheels deliberately require POPCNT, which provides most of the
34
+ # performance benefit of -march=native while remaining a predictable target.
35
+ WHEEL_BUILD = os.environ.get('ROARINGBITMAP_BUILD_WHEEL') == '1'
36
+
32
37
  with open('README.rst') as inp:
33
38
  README = inp.read()
34
39
 
35
40
  METADATA = dict(name='roaringbitmap',
36
- version='0.7.2',
41
+ version='0.7.4',
37
42
  description='Roaring Bitmap',
38
43
  long_description=README,
44
+ long_description_content_type='text/x-rst',
39
45
  author='Andreas van Cranenburgh',
40
46
  author_email='A.W.van.Cranenburgh@rug.nl',
41
47
  url='http://roaringbitmap.readthedocs.io',
42
- license='GPL',
48
+ license='GPL-2.0-or-later',
43
49
  platforms=['Many'],
44
50
  classifiers=[
45
51
  'Development Status :: 4 - Beta',
46
52
  'Intended Audience :: Science/Research',
47
- 'License :: OSI Approved :: GNU General Public License (GPL)',
48
53
  'Operating System :: POSIX',
49
54
  'Programming Language :: Python :: 2.7',
50
55
  'Programming Language :: Python :: 3.3',
@@ -86,7 +91,13 @@ if __name__ == '__main__':
86
91
  extra_link_args = []
87
92
  if not DEBUG and sys.platform != 'win32':
88
93
  extra_compile_args += ['-O3', '-DNDEBUG']
89
- extra_compile_args += ['-mtune=native'] if MTUNE else ['-march=native']
94
+ if WHEEL_BUILD:
95
+ if platform.machine().lower() in ('amd64', 'x86_64'):
96
+ extra_compile_args += [
97
+ '-DROARINGBITMAP_REQUIRE_POPCNT=1', '-mpopcnt']
98
+ else:
99
+ extra_compile_args += (
100
+ ['-mtune=native'] if MTUNE else ['-march=native'])
90
101
  extra_link_args += ['-DNDEBUG']
91
102
  if USE_CYTHON:
92
103
  if DEBUG:
@@ -0,0 +1,30 @@
1
+ #ifndef ROARINGBITMAP_CPU_FEATURES_H_
2
+ #define ROARINGBITMAP_CPU_FEATURES_H_
3
+
4
+ #if defined(ROARINGBITMAP_REQUIRE_POPCNT) && defined(_MSC_VER)
5
+ #include <intrin.h>
6
+ #endif
7
+
8
+ /* Release wheels define this when they are compiled with -mpopcnt. Source
9
+ * builds and non-x86 wheels do not require features beyond their target's
10
+ * normal architecture baseline. */
11
+ static int roaring_cpu_supports_required_features(void) {
12
+ #if defined(ROARINGBITMAP_REQUIRE_POPCNT)
13
+ #if !(defined(__i386__) || defined(__x86_64__) || \
14
+ defined(_M_IX86) || defined(_M_X64))
15
+ return 0;
16
+ #elif defined(__GNUC__) || defined(__clang__)
17
+ return __builtin_cpu_supports("popcnt") != 0;
18
+ #elif defined(_MSC_VER)
19
+ int registers[4];
20
+ __cpuid(registers, 1);
21
+ return (registers[2] & (1 << 23)) != 0;
22
+ #else
23
+ return 0;
24
+ #endif
25
+ #else
26
+ return 1;
27
+ #endif
28
+ }
29
+
30
+ #endif