On Mon, May 25, 2020 at 9:15 AM <geoffr...@gmail.com> wrote:

> On Sunday, May 24, 2020 at 9:44:22 PM UTC-7, Martin Blais wrote:
>>
>> Just for fun I quickly added syntax for an optional time after the date
>> but just for Transaction directives here:
>> https://github.com/beancount/beancount/tree/adding_time
>> Not even using it yet.
>> That's an 8.7% cost on the average run time.
>>
>> That seems like a pretty big cost for just parsing timestamps which are
> only useful in a minority of situations.  While I am really impressed with
> it, Beancount's strength isn't exactly in its performance, so I'd hate to
> make it even slower unless there was high ROI.  I am sure others would find
> intra-day trading to be a nice benefit, but for me, sorting by line-number
> is sufficient.
>

OTOH I can probably halve the time parsing takes (which is about half the
total processing time on my ledger) if I just as much as rewrite some of
the lexer and parser in C. The parser calls back to Python drivers in these
two files:
https://github.com/beancount/beancount/blob/master/beancount/parser/lexer.py
https://github.com/beancount/beancount/blob/master/beancount/parser/grammar.py
This was great for iterating 5+ years ago but frankly now that the desired
behavior has been teased out and gelled, it's probably fair to do that.

I'm resisting spending the time to do this right now because I'll be
rewriting the whole parser with a re/flex scanner (UTF8 support) and parser
generator in C++ in V3, with no Python code in that loop. This would
involve introducing dependencies on the C++ language which brings a whole
other set of issues, and purely C++ data structures (as protos), so I've
postponed this for V3.

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhNGYTOGUeH8vMiTKhG4iA2Gso6MS5o7c8XWhu5WZBJ%3DPA%40mail.gmail.com.

Reply via email to