Transducers in Swift
This repo contains a
.playground file and various benchmarking files that attempt to explain what transducers are and how to implement them in Swift.
The markdown view in Playground be toggled by switching
Editor -> Show Rendered Markup || Show Raw Markup
in the Xcode menus.
Benchmark directory contains the Attabench Xcode project file that was used to generate all the performance graphs used in the blog.
In addition, assembly code of all versions are available for a more in depth comparison.
The file used to generate the assembly is
AssemblyTest.swift. If you want to
play around with it, use the following command to generate your own
xcrun -sdk macosx swiftc -emit-assembly main.swift > result.asm
If you want to check out what this Playground is about but don't want to download it, here a link to my blog post that is basically its copy.
Got something to say? Get on Reddit!
This project is licensed under the terms of the MIT license. See the license file.