Commit 3804539
committed
Replace random(), pg_erand48(), etc with a better PRNG API and algorithm.
Standardize on xoroshiro128** as our basic PRNG algorithm, eliminating
a bunch of platform dependencies as well as fundamentally-obsolete PRNG
code. In addition, this API replacement will ease replacing the
algorithm again in future, should that become necessary.
xoroshiro128** is a few percent slower than the drand48 family,
but it can produce full-width 64-bit random values not only 48-bit,
and it should be much more trustworthy. It's likely to be noticeably
faster than the platform's random(), depending on which platform you
are thinking about; and we can have non-global state vectors easily,
unlike with random(). It is not cryptographically strong, but neither
are the functions it replaces.
Fabien Coelho, reviewed by Dean Rasheed, Aleksander Alekseev, and myself
Discussion: https://postgr.es/m/alpine.DEB.2.22.394.2105241211230.165418@pseudo1 parent f44ceb4 commit 3804539
File tree
50 files changed
+544
-481
lines changed- contrib
- amcheck
- auto_explain
- file_fdw
- postgres_fdw
- tablefunc
- tsm_system_rows
- tsm_system_time
- src
- backend
- access
- gin
- gist
- nbtree
- spgist
- transam
- commands
- executor
- lib
- optimizer/geqo
- postmaster
- storage
- file
- ipc
- lmgr
- tcop
- utils
- adt
- misc
- bin
- initdb
- pg_test_fsync
- pgbench
- t
- common
- include
- common
- optimizer
- utils
- port
- test/modules
- test_bloomfilter
- test_integerset
- test_rbtree
- tools
- msvc
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
50 files changed
+544
-481
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16463 | 16463 | | |
16464 | 16464 | | |
16465 | 16465 | | |
16466 | | - | |
16467 | | - | |
16468 | | - | |
16469 | | - | |
16470 | | - | |
16471 | | - | |
16472 | | - | |
16473 | | - | |
16474 | | - | |
16475 | | - | |
16476 | | - | |
16477 | | - | |
16478 | | - | |
16479 | | - | |
16480 | | - | |
16481 | | - | |
16482 | | - | |
16483 | | - | |
16484 | | - | |
16485 | | - | |
16486 | | - | |
16487 | | - | |
16488 | | - | |
16489 | | - | |
16490 | | - | |
16491 | | - | |
16492 | 16466 | | |
16493 | 16467 | | |
16494 | 16468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1858 | 1858 | | |
1859 | 1859 | | |
1860 | 1860 | | |
1861 | | - | |
1862 | | - | |
1863 | 1861 | | |
1864 | 1862 | | |
1865 | 1863 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
466 | 467 | | |
467 | 468 | | |
468 | 469 | | |
469 | | - | |
470 | | - | |
| 470 | + | |
| 471 | + | |
471 | 472 | | |
472 | 473 | | |
473 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
275 | 276 | | |
276 | 277 | | |
277 | 278 | | |
278 | | - | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1188 | 1188 | | |
1189 | 1189 | | |
1190 | 1190 | | |
1191 | | - | |
| 1191 | + | |
1192 | 1192 | | |
1193 | 1193 | | |
1194 | 1194 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5158 | 5158 | | |
5159 | 5159 | | |
5160 | 5160 | | |
5161 | | - | |
| 5161 | + | |
5162 | 5162 | | |
5163 | 5163 | | |
5164 | 5164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
293 | | - | |
294 | | - | |
| 294 | + | |
| 295 | + | |
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
| 216 | + | |
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
320 | | - | |
| 320 | + | |
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | 233 | | |
234 | | - | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
| 241 | + | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | | - | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | 248 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
| 333 | + | |
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
787 | 788 | | |
788 | 789 | | |
789 | 790 | | |
790 | | - | |
| 791 | + | |
791 | 792 | | |
792 | 793 | | |
793 | 794 | | |
| |||
0 commit comments