Commit 0748db1
committed
Make ticking a bit more realistic in Imp tests
Current implementation of ticking in ImpSpec is a bit naive, since it
calls `TICK` rule for every slot. This is not only slow, but it also
does not match the reality. On an actual running node TICK is called
on every block, which happens on average every `1/activeSlotCoefficient`
number of slots. On mainnet this is about every 20 slots or every 20
seconds.
Switching to this approach makes imp tests significantly faster, namely
about 80% faster on the example of Conway imp tests.1 parent 2e373d8 commit 0748db1
File tree
3 files changed
+54
-18
lines changed- eras/shelley/impl/testlib/Test/Cardano/Ledger/Shelley
- libs/cardano-ledger-core
- src/Cardano/Ledger
3 files changed
+54
-18
lines changedLines changed: 41 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
259 | 259 | | |
260 | 260 | | |
261 | 261 | | |
262 | | - | |
| 262 | + | |
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
| |||
1343 | 1343 | | |
1344 | 1344 | | |
1345 | 1345 | | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1346 | 1357 | | |
1347 | 1358 | | |
1348 | 1359 | | |
1349 | 1360 | | |
1350 | 1361 | | |
1351 | 1362 | | |
| 1363 | + | |
| 1364 | + | |
1352 | 1365 | | |
1353 | | - | |
1354 | | - | |
1355 | | - | |
1356 | | - | |
1357 | | - | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
1358 | 1372 | | |
1359 | | - | |
1360 | | - | |
1361 | | - | |
1362 | | - | |
1363 | | - | |
1364 | | - | |
1365 | | - | |
1366 | | - | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
1367 | 1386 | | |
1368 | 1387 | | |
1369 | 1388 | | |
| |||
1869 | 1888 | | |
1870 | 1889 | | |
1871 | 1890 | | |
1872 | | - | |
| 1891 | + | |
| 1892 | + | |
1873 | 1893 | | |
1874 | 1894 | | |
1875 | 1895 | | |
| |||
1881 | 1901 | | |
1882 | 1902 | | |
1883 | 1903 | | |
1884 | | - | |
| 1904 | + | |
| 1905 | + | |
1885 | 1906 | | |
1886 | 1907 | | |
1887 | 1908 | | |
| |||
1893 | 1914 | | |
1894 | 1915 | | |
1895 | 1916 | | |
1896 | | - | |
| 1917 | + | |
| 1918 | + | |
1897 | 1919 | | |
1898 | 1920 | | |
1899 | 1921 | | |
| |||
1905 | 1927 | | |
1906 | 1928 | | |
1907 | 1929 | | |
1908 | | - | |
| 1930 | + | |
| 1931 | + | |
1909 | 1932 | | |
1910 | 1933 | | |
1911 | 1934 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
| |||
485 | 488 | | |
486 | 489 | | |
487 | 490 | | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
488 | 500 | | |
489 | 501 | | |
490 | 502 | | |
| |||
0 commit comments