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<'_> {
350
350
flame_guard ! ( format!( "Frame::run({})" , self . code. obj_name) ) ;
351
351
// Execute until return or exception:
352
352
let instrs = & self . code . instructions ;
353
+ let mut gc_cnt = 0 ;
353
354
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
+ }
355
360
let idx = self . lasti ( ) as usize ;
356
361
self . update_lasti ( |i| * i += 1 ) ;
357
362
let instr = & instrs[ idx] ;
Original file line number Diff line number Diff line change @@ -454,7 +454,7 @@ impl Collector {
454
454
return false ;
455
455
}
456
456
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 {
458
458
* last_gc_time = Instant :: now ( ) ;
459
459
true
460
460
} else {
You can’t perform that action at this time.
0 commit comments