Skip to content

Make larger shortcut weight possible - #2376

Merged
karussell merged 10 commits into
masterfrom
bigger_shortcut_weight
Jul 29, 2021
Merged

karussell merged 10 commits into
masterfrom
bigger_shortcut_weight

Conversation

@karussell

@karussell karussell commented Jul 27, 2021 •

Copy link
Copy Markdown
Member

Fixes #1544. It even uses 32 instead of the proposed 30 bits for the weights (since the second commit). This idea is from @easbar :)

It should also fix #1022.

@karussell karussell added this to the 4.0 milestone Jul 27, 2021
@karussell karussell changed the title Bigger shortcut weight Make larger shortcut weight possible Jul 27, 2021

private int getNodeA(long edgePointer) {
return shortcuts.getInt(edgePointer + E_NODEA);
return shortcuts.getInt(edgePointer + E_NODEA) >>> 1;

@karussell karussell Jul 27, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

no need to convert to long and do the mask with 0xFFFFFFFFL (see the weight value where we have to do this), because we only use 31 bits and they fit into a signed int (after we do the unsigned shift).

@easbar easbar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks :) LGTM, just some suggestions, see inline comments.

@karussell
karussell merged commit 81105c9 into master Jul 29, 2021
@karussell
karussell deleted the bigger_shortcut_weight branch July 29, 2021 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use 32 bits for shortcuts instead of just 31 Large distant searches by foot result in connection not found

3 participants