tari-project / tari

The Tari protocol
https://tari.com
BSD 3-Clause "New" or "Revised" License
356 stars 220 forks source link

feat: improve header validation speed #6510

Closed SWvheerden closed 3 months ago

SWvheerden commented 3 months ago

Description

Improves the header validation speed by caching the gen block hash creation.

Motivation and Context

This is very noticeable during sync, but it takes about 10ms to create the gen block, and if you only want the hash, this can speed up validation a lot if you do this repeatedly.

After this pr, the validation of Sha3x: 10ms -> 10us RandomX: 20ms -> 10ms

How Has This Been Tested?

Manual

github-actions[bot] commented 3 months ago

Test Results (CI)

    3 files    129 suites   36m 37s :stopwatch: 1 306 tests 1 305 :white_check_mark: 0 :zzz: 1 :x: 3 904 runs  3 903 :white_check_mark: 0 :zzz: 1 :x:

For more details on these failures, see this check.

Results for commit 552ec225.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

Test Results (Integration tests)

 2 files  + 2  11 suites  +11   32m 50s :stopwatch: + 32m 50s 36 tests +36  34 :white_check_mark: +34  0 :zzz: ±0  2 :x: +2  38 runs  +38  36 :white_check_mark: +36  0 :zzz: ±0  2 :x: +2 

For more details on these failures, see this check.

Results for commit 552ec225. ± Comparison against base commit 169572aa.