core icon indicating copy to clipboard operation
core copied to clipboard

Compare current fusion with closure trees to array structure based one

Open davidchase opened this issue 7 years ago • 5 comments

Based on Slack discussion with @briancavalier we would want to research the potentially differences (specifically performance) with current fusion implementation using closure tree structures compared to fusion using array structures.

Currently we have composition for something like Map fusion or map.map which simply looks like compose(f, source.f)

The array fusion would simply hold the functions inside an array [f, source.f, ...] and then apply the array to the source values.

davidchase avatar Mar 07 '18 18:03 davidchase

Could you provide a link to current code implementation, @davidchase ?

Frikki avatar May 11 '18 01:05 Frikki

A recent discussion in gitter reminded me of this post, which explored this idea in Scala: https://mpilquist.github.io/blog/2017/03/11/stackless-function-composition/

briancavalier avatar May 11 '18 02:05 briancavalier

@Frikki sure check out under src/fusion or this link and line number

https://github.com/mostjs/core/blob/master/packages/core/src/fusion/Map.js#L34

@briancavalier thanks for sharing 👍 the author is a local and went to same school as me.. small world :)

davidchase avatar May 11 '18 18:05 davidchase

why should we degrade most to stackless ? then we could simply export [] === Stream and we can apply map filter and such stuff on that :dagger:

frank-dspeed avatar Dec 22 '19 16:12 frank-dspeed

Hi @frank-dspeed. I'm not quite sure what you mean by "degrade most to stackless". Could you explain more and help us understand what you mean?

briancavalier avatar Dec 23 '19 01:12 briancavalier