Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread monarch_dodra
On Friday, 27 September 2013 at 15:22:14 UTC, H. S. Teoh wrote: On Fri, Sep 27, 2013 at 04:52:20PM +0200, JR wrote: On Friday, 27 September 2013 at 14:37:05 UTC, Dmitry Olshansky wrote: >27-Sep-2013 02:00, JR пишет: >And the answer is - don't use ENUM with ctRegex. The problem >is that >ctReg

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread Dmitry Olshansky
27-Sep-2013 18:52, JR пишет: (I was of the notion that that enum merely translate to compile-time-evaluated constants.) I've recently investigated similar problem w.r.t. performance of std.regex on particular use-case/pattern. In fact it dig up an interesting bug with inlining in the compile

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread H. S. Teoh
On Fri, Sep 27, 2013 at 04:52:20PM +0200, JR wrote: > On Friday, 27 September 2013 at 14:37:05 UTC, Dmitry Olshansky > wrote: > >27-Sep-2013 02:00, JR пишет: > > >And the answer is - don't use ENUM with ctRegex. The problem is that > >ctRegex returns you a pack of datastructures (=arrays). Using

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread JR
On Friday, 27 September 2013 at 14:37:05 UTC, Dmitry Olshansky wrote: 27-Sep-2013 02:00, JR пишет: And the answer is - don't use ENUM with ctRegex. The problem is that ctRegex returns you a pack of datastructures (=arrays). Using them with enum makes it behave as if you pasted them as array

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-27 Thread Dmitry Olshansky
27-Sep-2013 02:00, JR пишет: I'm working on a toy IRC bot. Much of the logic involved is translating the incoming raw IRC string into something that makes sense (so now I have two problems, etc). But I managed to cook up a regex that so far seems to work well. Time for callgrind! Grouped by sour

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-26 Thread H. S. Teoh
On Fri, Sep 27, 2013 at 12:00:45AM +0200, JR wrote: > I'm working on a toy IRC bot. Much of the logic involved is > translating the incoming raw IRC string into something that makes > sense (so now I have two problems, etc). But I managed to cook up a > regex that so far seems to work well. Time fo

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-26 Thread H. S. Teoh
On Fri, Sep 27, 2013 at 01:51:51AM +0200, JR wrote: > On Thursday, 26 September 2013 at 23:04:22 UTC, bearophile wrote: > >I am not sure how a IRC bot could consume more than a tiny > >fraction of the CPU time of a modern multi-GHz processor. > > Nor does it bite into my 8 gigabytes of ram. > > F

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-26 Thread JR
On Thursday, 26 September 2013 at 23:04:22 UTC, bearophile wrote: I am not sure how a IRC bot could consume more than a tiny fraction of the CPU time of a modern multi-GHz processor. Nor does it bite into my 8 gigabytes of ram. Forgive me, but the main culprit in all of this is still me doing

Re: Regex matching cause lots of _d_arrayliteralTX calls

2013-09-26 Thread bearophile
JR: Is this working as expected? Or am I doing it wrong? I am not sure how a IRC bot could consume more than a tiny fraction of the CPU time of a modern multi-GHz processor. And I am not sure if regular expressions are a good idea to implement a IRC interface. But the author of the curre

Regex matching cause lots of _d_arrayliteralTX calls

2013-09-26 Thread JR
I'm working on a toy IRC bot. Much of the logic involved is translating the incoming raw IRC string into something that makes sense (so now I have two problems, etc). But I managed to cook up a regex that so far seems to work well. Time for callgrind! Grouped by source file, most time is spent