[svn:parrot] r39132 - trunk/src

chromatic chromatic at wgz.org
Sun May 24 08:13:06 UTC 2009


On Saturday 23 May 2009 21:02:49 bacek at svn.parrot.org wrote:

> Log:
> Cache created Proxy in Parrot_oo_get_class_str.
>
> This reduces Rakudo's startup time by about 25%.
>
> Modified:
>    trunk/src/oo.c
>
> Modified: trunk/src/oo.c
> --- trunk/src/oo.c	Sun May 24 04:00:25 2009	(r39131)
> +++ trunk/src/oo.c	Sun May 24 04:02:48 2009	(r39132)
> @@ -387,9 +387,17 @@
>          if (type > interp->n_vtable_max || type <= 0)
>              return PMCNULL;
>          else {
> +            PMC * new_class;
> +            PMC * new_ns;
>              PMC * const type_num = pmc_new(interp, enum_class_Integer);
>              VTABLE_set_integer_native(interp, type_num, type);
> -            return pmc_new_init(interp, enum_class_PMCProxy, type_num);
> +            new_ns = ns;
> +            new_class = pmc_new_init(interp, enum_class_PMCProxy,
> type_num); +            if (ns->vtable->base_type != enum_class_NameSpace)
> {
> +                new_ns = Parrot_make_namespace_keyed_str(interp, hll_ns,
> name); +            }
> +            Parrot_PCCINVOKE(interp, new_ns,
> Parrot_str_new_constant(interp, "set_class"), "P->", new_class); +         

This would be even faster if you used CONST_STRING instead of 
Parrot_str_new_constant().

-- c


More information about the parrot-dev mailing list