develooper Front page | perl.perl5.porters | Postings from November 2015

Re: eliminate bootstrap files on platforms that donotuse@DynaLoader::dl_resolve_using?

Thread Previous | Thread Next
From:
bulk88
Date:
November 5, 2015 06:04
Subject:
Re: eliminate bootstrap files on platforms that donotuse@DynaLoader::dl_resolve_using?
Message ID:
20151105060356.13348.qmail@lists-nntp.develooper.com
bulk88 wrote:
> Leon Timmermans wrote:
>> On Fri, Oct 30, 2015 at 12:00 PM, bulk88 <bulk88@hotmail.com
>> <mailto:bulk88@hotmail.com>> wrote:
>>     I managed to actually use a .bs file for its supposed purpose on
>>     Win32, but there are a huge amount of hurdles and bugs in the way,
>>     to use it seriously, I am thinking it is dead code.
>>
>>
>> I suspect the same TBH, but is that a problem?
>
> The .bs files (Mkbootstrap.pm specifically) are the holding me back from
> breaking dynamic XS module's dependency's on DynaLoader.pm being built
> first (see Extensions node in attached pic). There is another way to
> remove that dependency without removing bootstrap files, but while I am
> on the topic of bootstrap files, I need to fully work them up and
> examine their implementation and there should be a discussion on whether
> they are still needed in 2015 and how much they are needed. Rewriting
> code and leaving all bugs in, because they were there before, isnt very
> smart. Either fix it and advertise it, or throw it out.
>
> Checking for bootstrap files are an IO call (or 5 of them on Win32 due
> to Perl's win32 stat) to check for the file. Reducing disk I/O is never
> a bad thing. Also less memory for ops in XSLoader/DynaLoader since some
> stmts and blocks were removed.
>
> The bootstrap target takes 157 ms (make tool's timestamps, entire Foo.bs
> target) for me to execute all together, so making the section empty
> would speedup XS module building.

I did some benchmarking to see what the benefits of removing bootstrap 
files from EUMM are. There are 2 rough patches attached. "XS DLLs dont 
need dynaloader anymore" is after patch "no more bootstrap EUMM 
section". 14 seconds is saved by not writing a bootstrap makefile 
section, and therefore not executing it in the maketool, during a perl 
core build.

cmd: timeit dmake -P8 Extensions CCTYPE=MSVC90 WIN64=undef

"Extensions" builds all DLL XS modules with 1 invoke of make_ext.pl, the 
8 jobs has no meaning inside 1 make_ext.pl run. Extensions does not 
include static (there is only 1 for Win32 Perl) and nonxs modules.

before at SHA-1: a4a12576beffb0a87af8e541b0cbe0b9e1d10c9f

Version Number:   Windows NT 5.2 (Build 3790)
Exit Time:        11:35 pm, Wednesday, November 4 2015
Elapsed Time:     0:07:07.343
Process Time:     0:00:02.296
System Calls:     8232160
Context Switches: 2869836
Page Faults:      5332987
Bytes Read:       1377948154
Bytes Written:    202836005
Bytes Other:      33137221

at commit "no more bootstrap EUMM section"

Version Number:   Windows NT 5.2 (Build 3790)
Exit Time:        11:43 pm, Wednesday, November 4 2015
Elapsed Time:     0:06:53.281
Process Time:     0:00:02.093
System Calls:     7785175
Context Switches: 2758377
Page Faults:      4987547
Bytes Read:       1367330141
Bytes Written:    211087466
Bytes Other:      31884287

Version Number:   Windows NT 5.2 (Build 3790)
Exit Time:        11:51 pm, Wednesday, November 4 2015
Elapsed Time:     0:06:52.906
Process Time:     0:00:01.984
System Calls:     7755209
Context Switches: 2752269
Page Faults:      4985819
Bytes Read:       1367115208
Bytes Written:    202446577
Bytes Other:      31869306


at commit "XS DLLs dont need dynaloader anymore"

Version Number:   Windows NT 5.2 (Build 3790)
Exit Time:        0:00 am, Thursday, November 5 2015
Elapsed Time:     0:06:55.296
Process Time:     0:00:02.343
System Calls:     7638673
Context Switches: 2723492
Page Faults:      4848361
Bytes Read:       1350818728
Bytes Written:    203155576
Bytes Other:      31391259

Version Number:   Windows NT 5.2 (Build 3790)
Exit Time:        0:18 am, Thursday, November 5 2015
Elapsed Time:     0:06:55.000
Process Time:     0:00:02.312
System Calls:     7624235
Context Switches: 2736936
Page Faults:      4858261
Bytes Read:       1351533739
Bytes Written:    203459134
Bytes Other:      31548943

It seems !@#$%^& dmake the maketool burned more IO and a little more CPU 
completely negating removing 2 Makefile.pl/module "dmake all"s, maybe my 
future dmake 4.13 would be better but I didn't use that here, I only 
used the public dmake release. "XS DLLs dont need dynaloader anymore" 
needs more revision to reduce the number of nodes in its dep graph. In 
any case, I proved removing bootstrap files from EUMM saves a very 
measurable amount of time (14 seconds).

There is an option, keep checking and running .bs files on all 
platforms, but dont generate the makefile section or make it empty 
string on everything but the 2 @DynaLoader::dl_resolve_using using 
platforms, freemint and HPUX. If a module really really cares, they can 
supply sub MY::dynamic_bs with something that is sane for that platform.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About