Skip to content

Commit 5507160

Browse files
stepanchegfacebook-github-bot
authored andcommitted
Use SmallMap in heap summary
Summary: Avoid making something accidentally non-deterministic. Reviewed By: bobyangyf Differential Revision: D38517534 fbshipit-source-id: b4f23d778b8c6ad477a9b2cf3bb749ac9d82a254
1 parent 62d9cc2 commit 5507160

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

starlark/src/values/layout/heap/profile/summary.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
* limitations under the License.
1616
*/
1717

18-
use std::collections::HashMap;
1918
use std::iter;
2019

20+
use starlark_map::small_map::SmallMap;
21+
2122
use crate::eval::runtime::profile::csv::CsvWriter;
2223
use crate::eval::runtime::small_duration::SmallDuration;
2324
use crate::values::layout::heap::profile::aggregated::AggregateHeapProfileInfo;
@@ -31,13 +32,13 @@ struct FuncInfo {
3132
/// Number of times this function was called
3233
pub calls: usize,
3334
/// Who called this function (and how many times each)
34-
pub callers: HashMap<StringId, usize>,
35+
pub callers: SmallMap<StringId, usize>,
3536
/// Time spent directly in this function
3637
pub time: SmallDuration,
3738
/// Time spent directly in this function and recursive functions.
3839
pub time_rec: SmallDuration,
3940
/// Allocations made by this function
40-
pub alloc: HashMap<&'static str, AllocCounts>,
41+
pub alloc: SmallMap<&'static str, AllocCounts>,
4142
}
4243

4344
impl FuncInfo {

0 commit comments

Comments
 (0)