Change 27406 by [EMAIL PROTECTED] on 2006/03/07 19:31:49

        Two more TODOs for those with C knowledge.

Affected files ...

... //depot/perl/pod/perltodo.pod#132 edit

Differences ...

==== //depot/perl/pod/perltodo.pod#132 (text) ====
Index: perl/pod/perltodo.pod
--- perl/pod/perltodo.pod#131~27404~    2006-03-07 11:23:14.000000000 -0800
+++ perl/pod/perltodo.pod       2006-03-07 11:31:49.000000000 -0800
@@ -372,6 +372,31 @@
 might want to determine what ops I<really> are the most commonly used. And in
 turn suggest evictions and promotions to achieve a better F<pp_hot.c>.
 
+=head2 Shrink struct context
+
+In F<cop.h>, we have
+
+    struct context {
+        U32            cx_type;        /* what kind of context this is */
+        union {
+       struct block    cx_blk;
+       struct subst    cx_subst;
+        } cx_u;
+    };
+
+There are less than 256 values for C<cx_type>, and the constituent parts
+C<struct block> and C<struct subst> both contain some C<U8> and C<U16> fields,
+so it should be possible to move them to the first word, and share space with
+a C<U8> C<cx_type>, saving 1 word.
+
+=head2 Allocate OPs from arenas
+
+Currently all new OP structures are individually malloc()ed and free()d.
+All C<malloc> implementations have space overheads, and are now as fast as
+custom allocates so it would both use less memory and less CPU to allocate
+the various OP structures from arenas. The SV arena code can probably be
+re-used for this.
+
 
 
 
End of Patch.

Reply via email to