digitalmars.D - Regex benchmarks in Rust, Scala, D and F#
- Karthikeyan (5/5) Jan 05 2016 Hi,
- deadalnix (5/10) Jan 05 2016 I'm willing to bet the bad result D has come from the use of DMD.
- =?UTF-8?Q?Martin_Dra=c5=a1ar?= via Digitalmars-d (5/18) Jan 05 2016 To be fair, they have results for DMD and LDC:
- Karthikeyan (3/23) Jan 05 2016 Relevant reddit
- Andrei Alexandrescu (4/22) Jan 05 2016 The benchmark measures a mixture of times, not only regex time. Could
- Daniel Kozak (8/21) Jan 06 2016 not at all:
- Gerald (4/9) Jan 05 2016 I notice he's using readln() instead of readln(buf) in the D
- Basile B. (2/5) Jan 05 2016 Yep. It's a life-changer. There's a before and an after.
- Gerald (3/8) Jan 05 2016 Tried it on my laptop, only shaved half a second off the total
- rsw0x (19/24) Jan 05 2016 k, I optimized it for fun
- Messenger (3/4) Jan 05 2016 Anyone on linux who could imgur a callgraph please? Premature
- rsw0x (10/14) Jan 05 2016 nearly all the time is spent inside the regex itself and
- israel (8/13) Jan 05 2016 I think the problem with these "benchmarks" is that when their
- wobbles (8/23) Jan 06 2016 That'll never work though.
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
Jan 05 2016
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.htmlI'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.
Jan 05 2016
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: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.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.htmlI'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.
Jan 05 2016
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):Relevant reddit discussion.https://www.reddit.com/r/rust/comments/3zh95h/regular_expressions_rust_vs_f_vs_scala_vs_d/On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote: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.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.htmlI'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.
Jan 05 2016
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):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)? -- AndreiOn Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote: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.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.htmlI'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.
Jan 05 2016
On Tuesday, 5 January 2016 at 18:09:54 UTC, deadalnix wrote:On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote:not at all: D(LDC): 5.778s D(GDC): 5.612s D(DMD): 5.267s scalac: 5.748s rustc: 9.287s so DMD is the fastestHi, 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.htmlI'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.
Jan 06 2016
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.htmlI 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?
Jan 05 2016
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.
Jan 05 2016
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:Tried it on my laptop, only shaved half a second off the total time, was hoping for more.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.
Jan 05 2016
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.htmlk, 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.
Jan 05 2016
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.
Jan 05 2016
On Tuesday, 5 January 2016 at 23:24:24 UTC, Messenger wrote:On Tuesday, 5 January 2016 at 20:04:35 UTC, rsw0x wrote:nearly all the time is spent inside the regex itself and filtering out empty results, moving the file to /tmp(ramdisk) does nothing for performance with the way the problem is structured I'm not sure how it could be changed beyond some micro-optimizations, as you can't use matchAll afaict because the benchmark requires it to be line-by-line well, you probably could I just don't feel like coding it because I hate regex[...]Anyone on linux who could imgur a callgraph please? Premature optimisation and all that.
Jan 05 2016
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.htmlI think the problem with these "benchmarks" is that when their favorite language is up there and not doing as good as the others, people begin to yell out that they didnt optimize the code well, either through compiler flags or something else. There should be a public benchmark standard. No special functions. No special linker flags. Just the plain code and compilation process.
Jan 05 2016
On Wednesday, 6 January 2016 at 07:05:43 UTC, israel wrote:On Tuesday, 5 January 2016 at 17:52:39 UTC, Karthikeyan wrote:That'll never work though. 'Just the plain code' to me isn't 'just the plain code' to you. Ideally, a Git repo somewhere with a lot of benchmarks that the community can edit and make better. Over time (assuming the repo becomes somewhat popular) all benchmarking programs will use each language to it's fullest - thus giving accurate, comparable results across the board.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.htmlI think the problem with these "benchmarks" is that when their favorite language is up there and not doing as good as the others, people begin to yell out that they didnt optimize the code well, either through compiler flags or something else. There should be a public benchmark standard. No special functions. No special linker flags. Just the plain code and compilation process.
Jan 06 2016