in reply to Re: Weird performance issue with Strawberries and Inline::C
in thread Weird performance issue with Strawberries and Inline::C

C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL>perl -V:"cc(flags)?" cc='gcc'; ccflags=' -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCR +IPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv + -fno-strict-aliasing -mms-bitfields'; C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL>perl -MInline=force,no +isy,info test_inline.pl validate Stage <-----------------------Information Section--------------------------- +--------> Information about the processing of your Inline C code: Your source code needs to be compiled. I'll use this build directory: C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\_Inline\build\test_inl +ine_pl_62b5 and I'll install the executable as: C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\_Inline\lib\auto\test_ +inline_pl_62b5\test_inline_pl_62b5.xs.dll get_maps Stage The following Inline C function(s) have been successfully bound to Per +l: int test_c_3(SV * str) int test_c_4(SV * str) <-----------------------End of Information Section-------------------- +--------> Starting Build Preprocess Stage Finished Build Preprocess Stage Starting Build Parse Stage Finished Build Parse Stage Starting Build Glue 1 Stage Finished Build Glue 1 Stage Starting Build Glue 2 Stage Finished Build Glue 2 Stage Starting Build Glue 3 Stage Finished Build Glue 3 Stage Starting Build Compile Stage Starting "perl Makefile.PL" Stage Generating a gmake-style Makefile Writing Makefile for test_inline_pl_62b5 Writing MYMETA.yml and MYMETA.json Finished "perl Makefile.PL" Stage Starting "make" Stage Running Mkbootstrap for test_inline_pl_62b5 () "C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command -e chmod -- 644 "test_inline_pl_62b5.bs" "C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command::MM -e cp_nonempty -- test_inline_pl_62b5.bs blib\a +rch\auto\test_inline_pl_62b5\test_inline_pl_62b5.bs 644 "C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\bin\perl.exe" "C +:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\lib\ExtUtils/xsub +pp" -typemap "C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\l +ib\ExtUtils\typemap" test_inline_pl_62b5.xs > test_inline_pl_62b5.x +sc "C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command -e mv -- test_inline_pl_62b5.xsc test_inline_pl_62b +5.c gcc -c -iquote"C:/berrybrew/strawberry-perl-5.32.1.1-64bit-PDL" -DWIN +32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IM +PLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-a +liasing -mms-bitfields -s -O2 -DVERSION=\"0.00\" -DXS_VERSION=\"0.0 +0\" "-IC:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\lib\CORE +" test_inline_pl_62b5.c "C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"test_inline_pl_62b5\", 'DLBASE' => 'test +_inline_pl_62b5', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => +{ }, 'DL_VARS' => []);" g++.exe test_inline_pl_62b5.def -o blib\arch\auto\test_inline_pl_62b5\ +test_inline_pl_62b5.xs.dll -mdll -s -L"C:\berrybrew\strawberry-perl-5 +.32.1.1-64bit-PDL\perl\lib\CORE" -L"C:\berrybrew\strawberry-perl-5.32 +.1.1-64bit-PDL\c\lib" test_inline_pl_62b5.o "C:\berrybrew\strawberr +y-perl-5.32.1.1-64bit-PDL\perl\lib\CORE\libperl532.a" -lmoldname -lke +rnel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -l +ole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion - +lodbc32 -lodbccp32 -lcomctl32 -Wl,--enable-auto-image-base "C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command -e chmod -- 755 blib\arch\auto\test_inline_pl_62b5\ +test_inline_pl_62b5.xs.dll Finished "make" Stage Starting "make install" Stage "C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command::MM -e cp_nonempty -- test_inline_pl_62b5.bs blib\a +rch\auto\test_inline_pl_62b5\test_inline_pl_62b5.bs 644 Files found in blib\arch: installing files in blib\lib into architectu +re dependent library tree Installing C:\berrybrew\strawberry-perl-5.32.1.1-64bit-PDL\_Inline\lib +\auto\test_inline_pl_62b5\test_inline_pl_62b5.xs.dll Finished "make install" Stage Starting Cleaning Up Stage Finished Cleaning Up Stage Finished Build Compile Stage v5.32.1 String length: 100000 Rate c3 c4 c3 8706/s -- -0% c4 8706/s 0% --

...

C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL>perl -V:"cc(flags)?" cc='gcc'; ccflags='-std=c99 -DWIN32 -DWIN64 -DPERL_TEXTMODE_SCRIPTS -DMULTIPLICI +TY -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANSI_STDIO -fwrapv +-fno-strict-aliasing -mms-bitfields'; C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL>perl -MInline=force,no +isy,info test_inline.pl validate Stage <-----------------------Information Section--------------------------- +--------> Information about the processing of your Inline C code: Your source code needs to be compiled. I'll use this build directory: C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\_Inline\build\test_inl +ine_pl_62b5 and I'll install the executable as: C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\_Inline\lib\auto\test_ +inline_pl_62b5\test_inline_pl_62b5.xs.dll get_maps Stage The following Inline C function(s) have been successfully bound to Per +l: int test_c_3(SV * str) int test_c_4(SV * str) <-----------------------End of Information Section-------------------- +--------> Starting Build Preprocess Stage Finished Build Preprocess Stage Starting Build Parse Stage Finished Build Parse Stage Starting Build Glue 1 Stage Finished Build Glue 1 Stage Starting Build Glue 2 Stage Finished Build Glue 2 Stage Starting Build Glue 3 Stage Finished Build Glue 3 Stage Starting Build Compile Stage Starting "perl Makefile.PL" Stage Generating a gmake-style Makefile Writing Makefile for test_inline_pl_62b5 Writing MYMETA.yml and MYMETA.json Finished "perl Makefile.PL" Stage Starting "make" Stage Running Mkbootstrap for test_inline_pl_62b5 () "C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command -e chmod -- 644 "test_inline_pl_62b5.bs" "C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command::MM -e cp_nonempty -- test_inline_pl_62b5.bs blib\a +rch\auto\test_inline_pl_62b5\test_inline_pl_62b5.bs 644 "C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\bin\perl.exe" "C +:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\lib\ExtUtils/xsub +pp" -typemap "C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\l +ib\ExtUtils\typemap" test_inline_pl_62b5.xs > test_inline_pl_62b5.x +sc "C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command -e mv -- test_inline_pl_62b5.xsc test_inline_pl_62b +5.c gcc -c -iquote"C:/berrybrew/strawberry-perl-5.42.0.1-64bit-PDL" -std= +c99 -DWIN32 -DWIN64 -DPERL_TEXTMODE_SCRIPTS -DMULTIPLICITY -DPERL_IMP +LICIT_SYS -DUSE_PERLIO -D__USE_MINGW_ANSI_STDIO -fwrapv -fno-strict-a +liasing -mms-bitfields -O2 -DVERSION=\"0.00\" -DXS_VERSION=\"0.00\" + "-IC:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\lib\CORE" + test_inline_pl_62b5.c "C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"test_inline_pl_62b5\", 'DLBASE' => 'test +_inline_pl_62b5', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => +{ }, 'DL_VARS' => []);" g++.exe test_inline_pl_62b5.def -o blib\arch\auto\test_inline_pl_62b5\ +test_inline_pl_62b5.xs.dll -mdll -s -L"C:\berrybrew\strawberry-perl-5 +.42.0.1-64bit-PDL\perl\lib\CORE" -L"C:\berrybrew\strawberry-perl-5.42 +.0.1-64bit-PDL\c\lib" test_inline_pl_62b5.o "C:\berrybrew\strawberr +y-perl-5.42.0.1-64bit-PDL\perl\lib\CORE\libperl542.a" -lmoldname -lke +rnel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -l +ole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr -lwinmm -lversion - +lodbc32 -lodbccp32 -lcomctl32 -Wl,--enable-auto-image-base "C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command -e chmod -- 755 blib\arch\auto\test_inline_pl_62b5\ +test_inline_pl_62b5.xs.dll Finished "make" Stage Starting "make install" Stage "C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\perl\bin\perl.exe" -M +ExtUtils::Command::MM -e cp_nonempty -- test_inline_pl_62b5.bs blib\a +rch\auto\test_inline_pl_62b5\test_inline_pl_62b5.bs 644 Files found in blib\arch: installing files in blib\lib into architectu +re dependent library tree Installing C:\berrybrew\strawberry-perl-5.42.0.1-64bit-PDL\_Inline\lib +\auto\test_inline_pl_62b5\test_inline_pl_62b5.xs.dll Finished "make install" Stage Starting Cleaning Up Stage Finished Cleaning Up Stage Finished Build Compile Stage v5.42.0 String length: 100000 Rate c4 c3 c4 2456/s -- -72% c3 8706/s 254% --

Replies are listed 'Best First'.
Re^3: Weird performance issue with Strawberries and Inline::C
by ikegami (Patriarch) on Oct 13, 2025 at 00:37 UTC

    I see -O2 in both cases. It would be interesting to see the disassembly, but I'm not sure how to get that.