Simon Cozens wrote: > On Mon, Nov 05, 2001 at 02:08:21PM -0500, Ken Fox wrote: > > we'd be a lot better inlining some of the PMC methods as ops instead of > > trig functions. ;) > > Won't work. We can't predict what kind of PMCs will be coming our way, let > alone what vtables they'll use, let alone what methods those vtables will use > most often.
This is not appropriate for Parrot, but Perl should definitely have some of its own PMC ops inlined. IMHO Perl is getting some static typing ability, so it should be able to emit bytecode that doesn't go through the PMC vtable. If somebody adds type inferencing there would be even more opportunities for skipping the vtable. If Perl isn't able to infer the type of a PMC, it could still win by inlining a type check and the common case in a custom op. If the VM is automatically generated this could be done by looking at profiling info and inlining the hottest PMC methods. It seems feasible to even have multiple dispatch loops optimized for different types of apps, say PDL number crunching vs. XML munging. That's a lot of "ifs" and "shoulds" -- but I'd rather hear that instead of "can't". - Ken