Skip to content

Conversation

@GideonWhite1029
Copy link

@Taiyou06 Taiyou06 requested a review from HaHaWTH July 21, 2025 18:59
@Taiyou06 Taiyou06 added the type: general Pull request for general updates / changes label Jul 21, 2025
@HaHaWTH
Copy link
Member

HaHaWTH commented Jul 22, 2025

Is there any performance benchmark for this BLAKE3 implementation comparing to previous BLAKE2b?

@Taiyou06 Taiyou06 added the status: pending Pending for some reasons and may implement in the future with lower priority label Jul 25, 2025
Copy link
Member

@HaHaWTH HaHaWTH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally good, but need some benchmarks to make sure it's faster than original blake2b impl. Leave the old implementation as a compatibility option is better i assume

@GideonWhite1029
Copy link
Author

изображение изображение изображение изображение

There are places in the current Blake3 implementation that need to be optimized, and at the moment Blake2b will be faster compared to Blake3. Alternatively, you can leave both variations of the hash function and select the version through the configuration file.

private final long[] message = new long[16];
private final long[] cachedInternalState = new long[16];

private static long[] hashingWorldSeed(long[] seed) {
Copy link
Member

@Dreeam-qwq Dreeam-qwq Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move hashing algo type to config, and use interface-impl for 2b and 3?

cc @HaHaWTH

This comment was marked as duplicate.

@Dreeam-qwq Dreeam-qwq requested a review from HaHaWTH August 30, 2025 17:58
Copy link
Member

@HaHaWTH HaHaWTH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will run some performance benchmarks and validations later

private final long[] message = new long[16];
private final long[] cachedInternalState = new long[16];

private static long[] hashingWorldSeed(long[] seed) {

This comment was marked as duplicate.

- The execution time decreased from 757 ms to 550 ms
- Changed logic of the type of hashing in WorldgenCryptoRandom
- Added hashing for structures: MineshaftStructure, OceanMonumentStructure, RuinedPortalStructure
- Small fix Balke3
@GideonWhite1029
Copy link
Author

@Dreeam-qwq Consider the current changes in the implementation of Blake3, as well as evaluate the purity of the code?

Update hash function from Blake2 to Blake3
- The execution time decreased from 1.822 ms to 757 ms
- Precomputed permutations have been added to compress()
- The execution time decreased from 757 ms to 550 ms
- Changed logic of the type of hashing in WorldgenCryptoRandom
- Added hashing for structures: MineshaftStructure, OceanMonumentStructure, RuinedPortalStructure
- Small fix Balke3
# Conflicts:
#	leaf-server/minecraft-patches/features/0132-Faster-random-generator.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: pending Pending for some reasons and may implement in the future with lower priority type: general Pull request for general updates / changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants