Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP - discussion] - Alternate Method of Seq.map chaining #1528

Closed
wants to merge 1 commit into from

Conversation

liboz
Copy link
Contributor

@liboz liboz commented Sep 9, 2016

@forki
Hey, this is an example of the method I suggested for Seq.map chaining in #1525. I believe it could be safer than an expression optimizer. That said, I don't think this method has a very wide range of applicable situations. And although this method makes chaining Seq.map a decent amount faster for 64-bit (40% when just chaining the id function 4 times), it comes at the cost of more allocations; it also appears to do very little for 32-bit.

Chained with Cast = Map int->double->int->string->double->int
Chained = Map id 4 times
Double = Map id twice
Single = Map id once

Method Platform Jit count Median StdDev Gen 0 Gen 1 Gen 2 Bytes Allocated/Op
newMapChainedWithCast X64 RyuJit 10 2,681.3056 ns 54.0795 ns 1,689.20 - - 860.49
oldMapChainedWithCast X64 RyuJit 10 3,162.8985 ns 99.1808 ns 1,460.50 - - 759.68
newMapChained X64 RyuJit 10 999.2051 ns 21.7923 ns 950.20 - - 480.46
oldMapChained X64 RyuJit 10 1,602.6801 ns 62.1952 ns 876.30 - - 444.90
newMapDouble X64 RyuJit 10 672.5340 ns 11.1336 ns 591.66 - - 303.59
oldMapDouble X64 RyuJit 10 829.7948 ns 25.4848 ns 573.53 - - 291.14
newMapSingle X64 RyuJit 10 512.7723 ns 18.6634 ns 434.50 - - 224.26
oldMapSingle X64 RyuJit 10 517.8100 ns 17.3567 ns 434.09 - - 224.05
newMapChainedAndCast X86 LegacyJit 10 4,556.4599 ns 98.8518 ns 896.00 - - 464.44
oldMapChainedAndCast X86 LegacyJit 10 4,590.3545 ns 132.2131 ns 796.46 - - 413.15
newMapChained X86 LegacyJit 10 1,800.9681 ns 55.1074 ns 516.93 - - 270.98
oldMapChained X86 LegacyJit 10 1,988.7315 ns 54.5289 ns 496.59 - - 253.48
newMapDouble X86 LegacyJit 10 1,133.6465 ns 29.1723 ns 364.62 - - 190.35
oldMapDouble X86 LegacyJit 10 1,135.3443 ns 40.1621 ns 365.74 - - 191.04
newMapSingle X86 LegacyJit 10 714.6264 ns 19.5114 ns 299.75 - - 151.89
oldMapSingle X86 LegacyJit 10 720.0241 ns 154.7598 ns 302.13 - - 153.09

@KevinRansom KevinRansom changed the title Alternate Method of Seq.map chaining [WIP - discussion] - Alternate Method of Seq.map chaining Sep 16, 2016
manofstick added a commit to manofstick/visualfsharp that referenced this pull request Sep 27, 2016
A generalized version, with a bit more flexible composition, of dotnet#1528.
@mrange
Copy link
Contributor

mrange commented Oct 27, 2016

I approve of your detailed measurements.... used any tool for that?

@liboz
Copy link
Contributor Author

liboz commented Oct 27, 2016

@mrange I used BenchmarkDotNet. Here is an example of a script that uses it: https://gist.github.com/liboz/c9e529d0292f25135243721157b93fae

@manofstick
Copy link
Contributor

@liboz should probably just close this given #1570?

@liboz liboz closed this Nov 2, 2016
@liboz liboz deleted the working3 branch December 24, 2016 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants