A short example of Parrot GC pain

0 views
Skip to first unread message

Patrick R. Michaud

unread,
Sep 5, 2010, 4:32:38 PM9/5/10
to parro...@lists.parrot.org
As reported a short while ago on #perl6 and #parrot:

pmichaud@orange:~/rakudo$ cat x.pir
.loadlib 'io_ops'

.sub 'main'
$P0 = open 'unixdict.txt', 'r'
$P0.'encoding'('utf8')
$S0 = $P0.'readall'()
$P0.'close'()
$I0 = length $S0
say $I0
.end

pmichaud@orange:~/rakudo$ time parrot_install/bin/parrot x.pir
206403

real 0m2.327s
user 0m2.310s
sys 0m0.020s

pmichaud@orange:~/rakudo$ diff x.pir y.pir
3a4
> load_bytecode 'perl6.pbc'

pmichaud@orange:~/rakudo$ time parrot_install/bin/parrot y.pir
206403

real 0m22.983s
user 0m22.380s
sys 0m0.160s

:-(

Notes:
1. It only takes about a second for y.pir to complete the
C<load_bytecode 'perl6.pbc'> step -- the increase in
execution time is almost entirely in the .'readall' method.
2. There's no "large Rakudo parse tree or ast" lying around
that would be artificially increasing the work of the GC --
this is truly compiled code.
3. The code in y.pir is running entirely in the 'parrot' HLL
namespace, there are no Rakudo-specific PMCs, subroutines,
dispatchers, etc. being used once the load_bytecode has
completed.

Pm
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

chromatic

unread,
Sep 5, 2010, 6:39:07 PM9/5/10
to parro...@lists.parrot.org
On Sunday 05 September 2010 at 13:32, Patrick R wrote:

> Notes:
> 1. It only takes about a second for y.pir to complete the
> C<load_bytecode 'perl6.pbc'> step -- the increase in
> execution time is almost entirely in the .'readall' method.
> 2. There's no "large Rakudo parse tree or ast" lying around
> that would be artificially increasing the work of the GC --
> this is truly compiled code.
> 3. The code in y.pir is running entirely in the 'parrot' HLL
> namespace, there are no Rakudo-specific PMCs, subroutines,
> dispatchers, etc. being used once the load_bytecode has
> completed.

How does the example fare for you with this patch?

no_gc_in_mem_allocate.patch

Patrick R. Michaud

unread,
Sep 5, 2010, 11:03:16 PM9/5/10
to chromatic, parro...@lists.parrot.org
On Sun, Sep 05, 2010 at 03:39:07PM -0700, chromatic wrote:
> How does the example fare for you with this patch?

The patch applies cleanly but the Parrot build fails at the
"parrot_nci_thunk_gen" step:

[...]
./parrot_nci_thunk_gen --dynext --no-warn-dups \
--output=src/extra_nci_thunks.c <src/nci/extra_thunks.nci
ccache gcc -I./include -I./include/pmc -D_GNU_SOURCE -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -DHASATTRIBUTE_HOT -DHASATTRIBUTE_COLD -DDISABLE_GC_DEBUG=1 -DNDEBUG -DHAS_GETTEXT -fPIC -O2 -g -falign-functions=16 -fvisibility=hidden -funit-at-a-time -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wlogical-op -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wmultichar -Wpacked -Wparentheses -Wpointer-arith -Wpointer-sign -Wreturn-type -Wsequence-point -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wno-unused -Wunknown-pragmas -Wvariadic-macros -Wwrite-strings -Wbad-function-cast -Wc++-compat -Wdeclaration-after-statement -Werror=declaration-after-statement -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnonnull -Wold-style-definition -fPIC -Isrc -o src/extra_nci_thunks.o -c src/extra_nci_thunks.c
src/extra_nci_thunks.c:1535:9: warning: null character(s) ignored
src/extra_nci_thunks.c: In function ‘pcf_p_Jipp’:
src/extra_nci_thunks.c:1535: error: stray ‘\320’ in program
src/extra_nci_thunks.c:1535: error: ‘A’ undeclared (first use in this function)
src/extra_nci_thunks.c:1535: error: (Each undeclared identifier is reported only once
src/extra_nci_thunks.c:1535: error: for each function it appears in.)
src/extra_nci_thunks.c:1535: error: expected ‘;’ before ‘)’ token
src/extra_nci_thunks.c:1535: error: expected statement before ‘)’ token
src/extra_nci_thunks.c:1535: error: stray ‘\1’ in program
src/extra_nci_thunks.c:1535: error: ‘_1’ undeclared (first use in this function)
src/extra_nci_thunks.c:1536: error: ISO C90 forbids mixed declarations and code
src/extra_nci_thunks.c:1539: error: ‘t_1’ undeclared (first use in this function)
src/extra_nci_thunks.c: At top level:
src/extra_nci_thunks.c:6704: warning: no previous prototype for ‘Parrot_lib_extra_nci_thunks_init’
make: *** [src/extra_nci_thunks.o] Error 1
pmichaud@plum:~/parrot/trunk$

Pm
_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply all
Reply to author
Forward
0 new messages