| Thread overview | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 05, 2016 Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Hi, Came across this post in rust-lang subreddit about the regex benchamrks. Scala surprisingly outperforms D. LDC also gives a good advantage for efficiency of D. http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html | ||||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Karthikeyan | On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote:
> Hi,
>
> Came across this post in rust-lang subreddit about the regex benchamrks. Scala surprisingly outperforms D. LDC also gives a good advantage for efficiency of D.
>
> http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html
I'm willing to bet the bad result D has come from the use of DMD.
Honestly, pushing DMD as the reference implementation cost us quite a lot on the PR side of things. D appears to be slower that it really is.
| |||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to deadalnix | Dne 5.1.2016 v 19:09 deadalnix via Digitalmars-d napsal(a):
> On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote:
>> Hi,
>>
>> Came across this post in rust-lang subreddit about the regex benchamrks. Scala surprisingly outperforms D. LDC also gives a good advantage for efficiency of D.
>>
>> http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html
>
> I'm willing to bet the bad result D has come from the use of DMD.
>
> Honestly, pushing DMD as the reference implementation cost us quite a lot on the PR side of things. D appears to be slower that it really is.
To be fair, they have results for DMD and LDC:
regex - 10.6 s (DMD), 7.8 s (LDC)
ctRegex! - 6.9 s (DMD), 6.6 s (LDC)
Although no information about compiler switches.
| |||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Martin Drašar | On Tuesday, 5 January 2016 at 18:13:00 UTC, Martin Drašar wrote: > Dne 5.1.2016 v 19:09 deadalnix via Digitalmars-d napsal(a): >> On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote: >>> Hi, >>> >>> Came across this post in rust-lang subreddit about the regex benchamrks. Scala surprisingly outperforms D. LDC also gives a good advantage for efficiency of D. >>> >>> http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html >> >> I'm willing to bet the bad result D has come from the use of DMD. >> >> Honestly, pushing DMD as the reference implementation cost us quite a lot on the PR side of things. D appears to be slower that it really is. > > To be fair, they have results for DMD and LDC: > > regex - 10.6 s (DMD), 7.8 s (LDC) > ctRegex! - 6.9 s (DMD), 6.6 s (LDC) > > Although no information about compiler switches. Relevant reddit discussion.https://www.reddit.com/r/rust/comments/3zh95h/regular_expressions_rust_vs_f_vs_scala_vs_d/ | |||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Karthikeyan | On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote:
> Hi,
>
> Came across this post in rust-lang subreddit about the regex benchamrks. Scala surprisingly outperforms D. LDC also gives a good advantage for efficiency of D.
>
> http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html
I notice he's using readln() instead of readln(buf) in the D solution, would having D re-use the buffer make a substantial improvement in performance?
| |||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Martin Drašar | On 01/05/2016 01:13 PM, Martin Drašar via Digitalmars-d wrote:
> Dne 5.1.2016 v 19:09 deadalnix via Digitalmars-d napsal(a):
>> On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote:
>>> Hi,
>>>
>>> Came across this post in rust-lang subreddit about the regex
>>> benchamrks. Scala surprisingly outperforms D. LDC also gives a good
>>> advantage for efficiency of D.
>>>
>>> http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html
>>
>> I'm willing to bet the bad result D has come from the use of DMD.
>>
>> Honestly, pushing DMD as the reference implementation cost us quite a
>> lot on the PR side of things. D appears to be slower that it really is.
>
> To be fair, they have results for DMD and LDC:
>
> regex - 10.6 s (DMD), 7.8 s (LDC)
> ctRegex! - 6.9 s (DMD), 6.6 s (LDC)
>
> Although no information about compiler switches.
The benchmark measures a mixture of times, not only regex time. Could somebody tweak the benchmark and figure what the individual timings are (I/O vs. regex vs. the pipeline vs. appending)? -- Andrei
| |||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Gerald | On Tuesday, 5 January 2016 at 18:19:23 UTC, Gerald wrote:
> I notice he's using readln() instead of readln(buf) in the D solution, would having D re-use the buffer make a substantial improvement in performance?
Yep. It's a life-changer. There's a before and an after.
| |||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Basile B. | On Tuesday, 5 January 2016 at 18:21:39 UTC, Basile B. wrote:
> On Tuesday, 5 January 2016 at 18:19:23 UTC, Gerald wrote:
>> I notice he's using readln() instead of readln(buf) in the D solution, would having D re-use the buffer make a substantial improvement in performance?
>
> Yep. It's a life-changer. There's a before and an after.
Tried it on my laptop, only shaved half a second off the total time, was hoping for more.
| |||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Karthikeyan | On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote: > Hi, > > Came across this post in rust-lang subreddit about the regex benchamrks. Scala surprisingly outperforms D. LDC also gives a good advantage for efficiency of D. > > http://vaskir.blogspot.ru/2015/09/regular-expressions-rust-vs-f.html k, I optimized it for fun https://paste.ee/p/Bb1Ns I also found an mmfile bug if someone could report it for me, if I don't add a root to the mmfile contents(or disable the GC) the program will crash ctregex for both his: Elapsed: 6432 mine: Elapsed: 3123 ldc -O3 -release -boundscheck=off -singleobj regex.d does not compile with the latest gdc on arch linux(no lineSplitter) you could probably get it faster by reusing a buffer(I forget which call this is, but it exists in phobos) when reading the file but I felt like using mmfile as I've never used it before. Make sure you use a block-size buffer(e.g, 4096) Bye. | |||
January 05, 2016 Re: Regex benchmarks in Rust, Scala, D and F# | ||||
|---|---|---|---|---|
| ||||
Posted in reply to rsw0x | On Tuesday, 5 January 2016 at 20:04:35 UTC, rsw0x wrote:
>[...]
Anyone on linux who could imgur a callgraph please? Premature optimisation and all that.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply