Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a parallel sort to order txs while speculating #2424

Closed

Conversation

ljedrz
Copy link
Collaborator

@ljedrz ljedrz commented Apr 5, 2024

A small follow-up to https://github.com/AleoHQ/snarkVM/pull/2421. The changes are:

  • a cfg_sort_unstable_by macro for parallel sorting using a closure is introduced (note: the unstable part only means that equal elements may be reordered, and transaction IDs are never equal)
  • the aforementioned macro is used to sort transactions when speculating
  • the parallel iteration for the collection is removed, as it is slower than single-threaded iteration (since Transaction::id is basically free)
  • instead of enumerating and collecting indices, IndexSet::get_index_of is used

Signed-off-by: ljedrz <ljedrz@gmail.com>
@ljedrz ljedrz requested a review from howardwu April 5, 2024 08:56
@ljedrz
Copy link
Collaborator Author

ljedrz commented Apr 5, 2024

The CI jobs are failing due to a GitHub incident; will rerun a bit later.

@ljedrz ljedrz closed this Apr 5, 2024
@ljedrz ljedrz reopened this Apr 5, 2024
@ljedrz
Copy link
Collaborator Author

ljedrz commented Apr 5, 2024

It seems that for whatever reason the CI can't be triggered successfully after the GitHub failure; I'm going to open a new PR with a new branch name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant