File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use fsrs::FSRS;
1111use fsrs:: FSRSReview ;
1212use fsrs:: NextStates ;
1313use fsrs:: { FSRSItem , MemoryState } ;
14+ use fsrs:: { current_retrievability, FSRS6_DEFAULT_DECAY } ;
1415use itertools:: Itertools ;
1516
1617pub ( crate ) fn calc_mem ( inf : & FSRS , past_reviews : usize , card_cnt : usize ) -> Vec < MemoryState > {
@@ -83,6 +84,20 @@ pub fn criterion_benchmark(c: &mut Criterion) {
8384
8485 c. bench_function ( "next_states" , |b| b. iter ( || black_box ( next_states ( & fsrs) ) ) ) ;
8586
87+ c. bench_function ( "current_retrievability" , |b| {
88+ let state = MemoryState {
89+ stability : 51.344814 ,
90+ difficulty : 7.005062 ,
91+ } ;
92+ b. iter ( || {
93+ black_box ( current_retrievability (
94+ state,
95+ black_box ( 21.0 ) ,
96+ black_box ( FSRS6_DEFAULT_DECAY ) ,
97+ ) )
98+ } )
99+ } ) ;
100+
86101 {
87102 let mut single_group = c. benchmark_group ( "calc_mem" ) ;
88103 let n_cards = 1000 ;
You can’t perform that action at this time.
0 commit comments