File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -350,8 +350,13 @@ impl ExecutingFrame<'_> {
350350 flame_guard ! ( format!( "Frame::run({})" , self . code. obj_name) ) ;
351351 // Execute until return or exception:
352352 let instrs = & self . code . instructions ;
353+ let mut gc_cnt = 0 ;
353354 loop {
354- crate :: object:: try_gc ( ) ;
355+ gc_cnt += 1 ;
356+ if gc_cnt > 1000 {
357+ crate :: object:: try_gc ( ) ;
358+ gc_cnt = 0 ;
359+ }
355360 let idx = self . lasti ( ) as usize ;
356361 self . update_lasti ( |i| * i += 1 ) ;
357362 let instr = & instrs[ idx] ;
Original file line number Diff line number Diff line change @@ -454,7 +454,7 @@ impl Collector {
454454 return false ;
455455 }
456456 let mut last_gc_time = self . last_gc_time . lock ( ) ;
457- if last_gc_time. elapsed ( ) . as_millis ( ) >= 100 {
457+ if last_gc_time. elapsed ( ) . as_secs ( ) >= 1 {
458458 * last_gc_time = Instant :: now ( ) ;
459459 true
460460 } else {
You can’t perform that action at this time.
0 commit comments