… | |
… | |
1295 | ); |
1295 | ); |
1296 | |
1296 | |
1297 | our @isa_hook; |
1297 | our @isa_hook; |
1298 | |
1298 | |
1299 | sub _isa_set { |
1299 | sub _isa_set { |
1300 | my @pkg = ("AnyEvent", (grep defined, map $_->[0], @isa_hook), $MODEL); |
1300 | my @pkg = ("AnyEvent", (map $_->[0], grep defined, @isa_hook), $MODEL); |
1301 | |
1301 | |
1302 | @{"$pkg[$_-1]::ISA"} = $pkg[$_] |
1302 | @{"$pkg[$_-1]::ISA"} = $pkg[$_] |
1303 | for 1 .. $#pkg; |
1303 | for 1 .. $#pkg; |
1304 | |
1304 | |
1305 | grep $_->[1], @isa_hook |
1305 | grep $_ && $_->[1], @isa_hook |
1306 | and AE::_reset (); |
1306 | and AE::_reset (); |
1307 | } |
1307 | } |
1308 | |
1308 | |
1309 | # used for hooking AnyEvent::Strict and AnyEvent::Debug::Wrap into the class hierarchy |
1309 | # used for hooking AnyEvent::Strict and AnyEvent::Debug::Wrap into the class hierarchy |
1310 | sub _isa_hook($$;$) { |
1310 | sub _isa_hook($$;$) { |
1311 | my ($i, $pkg, $reset_ae) = @_; |
1311 | my ($i, $pkg, $reset_ae) = @_; |
1312 | |
1312 | |
1313 | $isa_hook[$i] = [$pkg, $reset_ae]; |
1313 | $isa_hook[$i] = $pkg ? [$pkg, $reset_ae] : undef; |
1314 | |
1314 | |
1315 | _isa_set; |
1315 | _isa_set; |
1316 | } |
1316 | } |
1317 | |
1317 | |
1318 | # all autoloaded methods reserve the complete glob, not just the method slot. |
1318 | # all autoloaded methods reserve the complete glob, not just the method slot. |
… | |
… | |
2420 | (even when used without AnyEvent), but most event loops have acceptable |
2420 | (even when used without AnyEvent), but most event loops have acceptable |
2421 | performance with or without AnyEvent. |
2421 | performance with or without AnyEvent. |
2422 | |
2422 | |
2423 | =item * The overhead AnyEvent adds is usually much smaller than the overhead of |
2423 | =item * The overhead AnyEvent adds is usually much smaller than the overhead of |
2424 | the actual event loop, only with extremely fast event loops such as EV |
2424 | the actual event loop, only with extremely fast event loops such as EV |
2425 | adds AnyEvent significant overhead. |
2425 | does AnyEvent add significant overhead. |
2426 | |
2426 | |
2427 | =item * You should avoid POE like the plague if you want performance or |
2427 | =item * You should avoid POE like the plague if you want performance or |
2428 | reasonable memory usage. |
2428 | reasonable memory usage. |
2429 | |
2429 | |
2430 | =back |
2430 | =back |