Hi,there!
By modifying the weight value of the routing attribute through the filter, the system becomes extremely sluggish, with bird consuming nearly 100% of the CPU.

OS: Alpine Linux 3.23
bird version: 2.18
filter code:
function xxx() {
    if (1, 1, 200)~ bgp_large_community then {
bgp_med = bgp_med + 500;
weight = 10;
    }
    if (1, 1, 197)~ bgp_large_community then {
bgp_med = bgp_med + 505;
weight = 20;
    }
}
system log:
Jan 10 00:03:19 r1 daemon.warn bird: I/O loop cycle took 30216.832 ms for 22 events
Jan 10 00:03:38 r1 daemon.warn bird: I/O loop cycle took 18453.030 ms for 23 events
Jan 10 00:03:56 r1 daemon.warn bird: I/O loop cycle took 18454.469 ms for 14 events
Jan 10 00:04:15 r1 daemon.warn bird: I/O loop cycle took 18441.226 ms for 13 events
Thank you