help-flex
[Top][All Lists]
Advanced

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

RE: performance bottleneck in yy_get_next_buffer function


From: Gautam Kapoor
Subject: RE: performance bottleneck in yy_get_next_buffer function
Date: Wed, 20 Feb 2013 12:30:01 +0530

Just to update everyone, I did play around with increasing the sizes of 
YY_BUF_SIZE and YY_READ_BUF_SIZE. This helped me reduce the number of times 
buffer was resizing and it improved the performance significantly.

-regards
Gautam

-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Gautam Kapoor
Sent: Tuesday, January 15, 2013 2:27 PM
To: Hans Åberg
Cc: address@hidden
Subject: RE: performance bottleneck in yy_get_next_buffer function

Hi Hans,
This is true both for flex and flex++.

Yes, my patch fixed that problem. Ideally, I would expect memcpy to be used 
instead of a for-do there. But Martin (attached email) suggests that it could 
be fixed by changing the buffer size. I have to try that. If one can choose an 
optimal buffer size (may not always be possible), then the effect of this 
for-do will be minimized.

-regards
Gautam

-----Original Message-----
From: Hans Åberg [mailto:address@hidden 
Sent: Thursday, January 10, 2013 5:00 AM
To: Gautam Kapoor
Cc: address@hidden
Subject: Re: performance bottleneck in yy_get_next_buffer function

On 9 Jan 2013, at 18:20, Gautam Kapoor <address@hidden> wrote:

> I want to discuss a particular performance issue and how I tried to fix it. I 
> am wondering why it is not part of the default scanner generated by flex 
> because I think the developers must have seen this too.

Flex is currently not developed or maintained, it seems. But a known problem is 
that rules that capture a lot of input slows the lexer down. So, for example, 
scanning for a comment spanning several lines is better done line by line.

Does your patch fix that problem?

Hans





reply via email to

[Prev in Thread] Current Thread [Next in Thread]