Bug 179958

Summary: Fast binding generation by batching several files at once
Product: WebKit Reporter: Basuke Suzuki <Basuke.Suzuki>
Component: Tools / TestsAssignee: Basuke Suzuki <Basuke.Suzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, Basuke.Suzuki, cdumez, commit-queue, don.olmstead, ews-watchlist, Hironori.Fujii, lforschler, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
fix
achristensen: review+, achristensen: commit-queue-
fixed none

Description Basuke Suzuki 2017-11-22 15:27:11 PST
Bindings generation spawns sub processes for each idl files, but fork/exec pattern is very slow on Windows. To reduce the process generation, control script can pass several files at once to the process.

Here is a statistics for 796 idl files:

Current imprementation: 386 secs
Batching 10 files:       63 secs
Aggressive approach:     36 secs (rest of files / number of process)
Comment 1 Basuke Suzuki 2017-11-22 15:41:47 PST
Created attachment 327472 [details]
patch
Comment 2 Basuke Suzuki 2017-11-27 16:09:58 PST
Created attachment 327708 [details]
fix
Comment 3 Alex Christensen 2017-11-28 10:43:33 PST
I'm ok with this as long as Sam doesn't object.
Comment 4 Alex Christensen 2017-11-28 11:19:57 PST
Comment on attachment 327708 [details]
fix

View in context: https://bugs.webkit.org/attachment.cgi?id=327708&action=review

> Source/WebCore/bindings/scripts/generate-bindings-all.pl:167
> +    my $batchCount = 30;
> +    # my $batchCount = int(($totalCount - $currentCount) / $numOfJobs) || 1;

Let's not comment out a line.  Also, the second line isn't quite right either.  As it is it strangely gives smaller batches as work progresses.  Let's do something more like $totalCount / $numOfJobs.
Comment 5 Basuke Suzuki 2017-12-05 17:28:03 PST
Created attachment 328537 [details]
fixed

fixed as Alex reviewed.
Comment 6 WebKit Commit Bot 2017-12-05 19:54:54 PST
Comment on attachment 328537 [details]
fixed

Clearing flags on attachment: 328537

Committed r225565: <https://trac.webkit.org/changeset/225565>
Comment 7 WebKit Commit Bot 2017-12-05 19:54:56 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2017-12-06 16:47:15 PST
<rdar://problem/35896591>