Skip to content

Commit

Permalink
perf: optimize memory_table
Browse files Browse the repository at this point in the history
  • Loading branch information
junyu0312 committed May 28, 2024
1 parent f65d1cd commit da63a43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/specs/src/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::sync::Arc;
use num_bigint::BigUint;
use rayon::iter::IntoParallelRefIterator;
use rayon::iter::ParallelIterator;
use rayon::prelude::ParallelSliceMut;

use crate::brtable::BrTable;
use crate::brtable::ElemTable;
Expand Down Expand Up @@ -110,7 +111,7 @@ impl Slice {

memory_entries.append(&mut set.into_iter().collect());

memory_entries.sort_unstable_by_key(|item| (item.ltype, item.offset, item.eid));
memory_entries.par_sort_unstable_by_key(|item| (item.ltype, item.offset, item.eid));

MTable::new(memory_entries)
}
Expand Down

0 comments on commit da63a43

Please sign in to comment.