mainBison - Support: sr #110729, m4 processing of large grammars...

 
 

sr #110729: m4 processing of large grammars slow

Submitter:  Andres Freund <anarazel>
Submitted:  Tue 20 Sep 2022 07:08:29 PM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Tue 20 Sep 2022 07:08:29 PM UTC, original submission:  

Hi,

translating postgres' bison grammars these days is the slowest build step of building postgres. Interestingly enough the time isn't even spent building the state machine or such, it's nearly all in m4.

Here's an example with postgres' main grammar. While there are other grammars that are slower to build, they require prior build steps.

curl -o gram.y 'https://git.postg ... er/gram.y;hb=HEAD'
$ /usr/bin/bison --trace=time -Wno-deprecated -o gram.c -d gram.y
bison (GNU Bison) 3.8.2
Execution times (seconds)
                          CPU user      CPU system    wall clock     
 reader                   0.044 ( 2%)   0.000 ( 0%)   0.044988 ( 2%)
 LR(0)                    0.038 ( 2%)   0.000 ( 0%)   0.038423 ( 2%)
 LALR(1)                  0.083 ( 4%)   0.003 (16%)   0.086182 ( 4%)
 parser action tables     0.149 ( 7%)   0.000 ( 0%)   0.149236 ( 7%)
 outputting parser        0.075 ( 3%)   0.003 (16%)   0.119665 ( 6%)
 running m4               1.518 (79%)   0.013 (66%)   1.454934 (76%)
 total time               1.914         0.020         1.900101

On slow systems this often ends up > 10s.

I don't know anything about m4, but perhaps there's something that can be done to speed this step up?

Regards,

Andres

Andres Freund <anarazel>

 

Attached Files

This item currently has no attached files.

(Note: upload size limit is set to 16MiB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by anarazel (Submitted the item)
  •  

    Votes

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    History

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.16.
    Corresponding source code