RE: Performance of pattern synonyms

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: Performance of pattern synonyms

GHC - devs mailing list

Are you as convinced as you were of the semantics of pattern synonyms?  I can see they are the right semantics given a run-time implementation but the alternative compile-time implementation has a lot to recommend it.

 

What exactly is “the alternative compile-time implementation”?

 

Remember, although pattern synonyms are set up to call a matching function, that matching function is often inlined, which reduces the overhead to zero.

 

I say “often” inlined.  An INLINE pragma for pattern synonyms would be a good feature.

 

Widening to ghc-devs.

 

Simon

 

 

From: Matthew Roberts <[hidden email]>
Sent: 11 February 2019 00:10
To: [hidden email]; [hidden email]; Simon Peyton Jones <[hidden email]>; [hidden email]
Subject: Performance of pattern synonyms

 

Hi all,

 

I am working with someone on a compile-time pattern matching extension and the most important prior work is pattern synonyms in Haskell.  I hope you might indulge a couple of questions I have not been able to answer myself from the literature:

 

  * [In my testing](http://pattern-benchmarks.herokuapp.com/posts/2019-02-09-peano.html), pattern synonyms have remarkable performance, has anyone ever benchmarked them before?

  * Do you have - on hand - the hackage data you used in investigating uses of pattern synonyms?  I am looking for real-world usage of pattern matching extensions.

  * Are you as convinced as you were of the semantics of pattern synonyms?  I can see they are the right semantics given a run-time implementation but the alternative compile-time implementation has a lot to recommend it.

 

Thanks for your time,

 

Matt Roberts

Department of Computing, Macquarie University

 

 


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Performance of pattern synonyms

Richard Eisenberg-4


On Feb 11, 2019, at 8:55 AM, Simon Peyton Jones <[hidden email]> wrote:

What exactly is “the alternative compile-time implementation”?

In my response, I interpreted this to be macro-expansion, the alternative we discuss in the paper. The paper includes a nice discussion of how the semantics differs between what we currently have and macro-expansion.

Richard

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Performance of pattern synonyms

Carter Schonwald
I'm looking at these links, but i'm actually having a hard time finding the actual different definitions of this microbenchmark...

On Mon, Feb 11, 2019 at 9:22 AM Richard Eisenberg <[hidden email]> wrote:


On Feb 11, 2019, at 8:55 AM, Simon Peyton Jones <[hidden email]> wrote:

What exactly is “the alternative compile-time implementation”?

In my response, I interpreted this to be macro-expansion, the alternative we discuss in the paper. The paper includes a nice discussion of how the semantics differs between what we currently have and macro-expansion.

Richard
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
Reply | Threaded
Open this post in threaded view
|

Re: Performance of pattern synonyms

Carter Schonwald
Hey Matthew, 
One dimension of analsysis that would be instructive would be to characterize the differences in core / stg for these different versions

Also : am I correct in believing that these all are the exact same algorithm in terms of representation or am I overlooking some differences between the 3 different codes ?

On Mon, Feb 11, 2019 at 4:07 PM Matthew Roberts <[hidden email]> wrote:
My apologies,

The link to the source was broken by some repo work - I have fixed it and it should be stable now.  This page was intended just to be a way of showing the results to my collaborators, not a full explanation that anyone can follow, but I thought the graphs at least show off what I am seeing.

Regardless, it is all there in the code and hopefully not too obtuse.  I can improve the discussion on the page if enough people are interested :)

Matt

On 12 Feb 2019, at 5:14 AM, Carter Schonwald <[hidden email]> wrote:

I'm looking at these links, but i'm actually having a hard time finding the actual different definitions of this microbenchmark...

On Mon, Feb 11, 2019 at 9:22 AM Richard Eisenberg <[hidden email]> wrote:


On Feb 11, 2019, at 8:55 AM, Simon Peyton Jones <[hidden email]> wrote:

What exactly is “the alternative compile-time implementation”?

In my response, I interpreted this to be macro-expansion, the alternative we discuss in the paper. The paper includes a nice discussion of how the semantics differs between what we currently have and macro-expansion.

Richard
_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs


_______________________________________________
ghc-devs mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs