[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnubol: Re: Cost of Backtracking



I ran 1,000 lines of cobol through btyacc as follows.

1000 lines of

   a of b of c of d of e of f.
(no backtracking) cpu time = .21 seconds per iteration.

1000 lines of 
   a of b of c.
   a of b of c (e).
   a of b of c (f:g).
   a of b of c (e) (f:g).
(ie 250 occurrences of each line).

Heaps of backtracking to trial the array references vs reference
modifications. 

CPU went up to .24 seconds per iteration.

(I had to put in a YYACCEPT at each fullstop to avoid the memory blowing
out due to combinatorial explosion).

My conclusion:

As long as we avoid combinatorial explosion, backtracking is not a
problem.

Tim Josling

--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.