Jump to page: 1 2
Thread overview
D std.regex is so slow
Sep 19, 2017
Daniel Kozak
Sep 19, 2017
rikki cattermole
Sep 19, 2017
Dmitry Olshansky
Sep 19, 2017
John Colvin
Sep 19, 2017
Jon Degenhardt
Sep 19, 2017
Daniel Kozak
Sep 19, 2017
jmh530
Sep 19, 2017
Dmitry Olshansky
Sep 19, 2017
Daniel Kozak
Sep 20, 2017
Dmitry Olshansky
Sep 20, 2017
Daniel Kozak
Sep 20, 2017
Dmitry Olshansky
Sep 19, 2017
12345swordy
September 19, 2017
https://github.com/mariomka/regex-benchmark#performance

Do you know why?

Here is a code:
https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d

I have try it with ldc too, but is still much slower (10x) than PHP
September 19, 2017
On 19/09/2017 8:53 AM, Daniel Kozak wrote:
> https://github.com/mariomka/regex-benchmark#performance
> 
> Do you know why?
> 
> Here is a code:
> https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
> 
> I have try it with ldc too, but is still much slower (10x) than PHP

Most likely everything below D is being JIT'd.
September 19, 2017
On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote:
> https://github.com/mariomka/regex-benchmark#performance
>
> Do you know why?
>
> Here is a code:
> https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
>
> I have try it with ldc too, but is still much slower (10x) than PHP

Well I'd be interested in getting the data. The benchmark looks fine.

---
Dmitry Olshansky
September 19, 2017
On Tuesday, 19 September 2017 at 10:14:05 UTC, Dmitry Olshansky wrote:
> On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote:
>> https://github.com/mariomka/regex-benchmark#performance
>>
>> Do you know why?
>>
>> Here is a code:
>> https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
>>
>> I have try it with ldc too, but is still much slower (10x) than PHP
>
> Well I'd be interested in getting the data. The benchmark looks fine.
>
> ---
> Dmitry Olshansky

As mentioned in the REAME: https://raw.githubusercontent.com/mariomka/regex-benchmark/master/input-text.txt
September 19, 2017
On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote:
> https://github.com/mariomka/regex-benchmark#performance
>
> Do you know why?
>
> Here is a code:
> https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
>
> I have try it with ldc too, but is still much slower (10x) than PHP

Might get some gain by compiling with '-flto-full'. Was faster on a regex test I ran, though not nearly the deltas shown.

--Jon
September 19, 2017
I have tried it, but does not change anything

On Tue, Sep 19, 2017 at 6:05 PM, Jon Degenhardt via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote:
>
>> https://github.com/mariomka/regex-benchmark#performance
>>
>> Do you know why?
>>
>> Here is a code: https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
>>
>> I have try it with ldc too, but is still much slower (10x) than PHP
>>
>
> Might get some gain by compiling with '-flto-full'. Was faster on a regex test I ran, though not nearly the deltas shown.
>
> --Jon
>


September 19, 2017
On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote:
> https://github.com/mariomka/regex-benchmark#performance
>
> Do you know why?
>
> Here is a code:
> https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
>
> I have try it with ldc too, but is still much slower (10x) than PHP

Looks like they added ldc to it. I'm seeing 3x slower than PHP on Email and URI, but roughly par on IP. It really stands out on the DMD one how much better it does on the IP one than the Email/URI ones.
September 19, 2017
On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote:
> https://github.com/mariomka/regex-benchmark#performance
>
> Do you know why?
>
> Here is a code:
> https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
>
> I have try it with ldc too, but is still much slower (10x) than PHP

Irc a rewrite is in the work.
September 19, 2017
On Tuesday, 19 September 2017 at 16:27:51 UTC, jmh530 wrote:
> On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote:
>> https://github.com/mariomka/regex-benchmark#performance
>>
>> Do you know why?
>>
>> Here is a code:
>> https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
>>
>> I have try it with ldc too, but is still much slower (10x) than PHP
>
> Looks like they added ldc to it. I'm seeing 3x slower than PHP on Email and URI, but roughly par on IP. It really stands out on the DMD one how much better it does on the IP one than the Email/URI ones.

IP is detected to be "semi-fixed" thus hitting a nice fast path.

Others would have worked with BitNFA, a patch that we had to revert because auto-tester run out of memory.



September 19, 2017
Is there a plan to make BitNFA back? Is possible that newCTFE will improve problem with memory? Or it is possible to improve those slow cases?

On Tue, Sep 19, 2017 at 8:12 PM, Dmitry Olshansky via Digitalmars-d < digitalmars-d@puremagic.com> wrote:

> On Tuesday, 19 September 2017 at 16:27:51 UTC, jmh530 wrote:
>
>> On Tuesday, 19 September 2017 at 07:53:27 UTC, Daniel Kozak wrote:
>>
>>> https://github.com/mariomka/regex-benchmark#performance
>>>
>>> Do you know why?
>>>
>>> Here is a code: https://github.com/mariomka/regex-benchmark/blob/master/d/benchmark.d
>>>
>>> I have try it with ldc too, but is still much slower (10x) than PHP
>>>
>>
>> Looks like they added ldc to it. I'm seeing 3x slower than PHP on Email and URI, but roughly par on IP. It really stands out on the DMD one how much better it does on the IP one than the Email/URI ones.
>>
>
> IP is detected to be "semi-fixed" thus hitting a nice fast path.
>
> Others would have worked with BitNFA, a patch that we had to revert because auto-tester run out of memory.
>
>
>
>


« First   ‹ Prev
1 2