| Method | Mean | Error | StdDev | Gen0 | Allocated |
|---|---|---|---|---|---|
| SumLoopShort | 2.371 ns | 0.0380 ns | 0.0356 ns | - | - |
| SumLinqShort | 2.849 ns | 0.0505 ns | 0.0473 ns | - | - |
| SumLoopLong | 3,557.375 ns | 29.2171 ns | 24.3976 ns | - | - |
| SumLinqLong | 599.220 ns | 3.5048 ns | 3.2784 ns | - | - |
| ComplexSumLoopLong | 19,158.862 ns | 374.6008 ns | 367.9080 ns | - | - |
| ComplexSumLinqLong | 27,317.165 ns | 267.0329 ns | 249.7828 ns | - | 48 B |
| ComplexSumLoopShort | 2.676 ns | 0.0363 ns | 0.0283 ns | - | - |
| ComplexSumLinqShort | 21.36 ns | 0.2747 ns | 0.2435 ns | 0.0124 | 48 B |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| HotSwap shader sytem for MonoGame | |
| HotSwap code only exists for debug builds | |
| Edit paths to match your project | |
| Construct in your Initialize method | |
| Add shaders in LoadContent (or whenever) | |
| Call CheckForChanges in Update() or periodically however you like | |
| mgcb.exe usually located in C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Jobs; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| public interface Cool | |
| { | |
| bool IsCool(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // A header file to get you set going with Intel SIMD instrinsic programming. | |
| // All necessary header files are inlucded for SSE2, SSE41, and AVX2 | |
| // Macros make the intrinsics easier to read and generic so you can compile to | |
| // SSE2 or AVX2 with the flip of a #define | |
| #define SSE2 //indicates we want SSE2 | |
| #define SSE41 //indicates we want SSE4.1 instructions (floor and blend is available) | |
| #define AVX2 //indicates we want AVX2 instructions (double speed!) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using Microsoft.Xna.Framework; | |
| //Faster linq-style convenience functions https://github.com/jackmott/LinqFaster | |
| using JM.LinqFaster; | |
| namespace DrawAndDrive | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Diagnostics; | |
| using System.Collections.Generic; | |
| using System.Threading; | |
| namespace bettercraft | |
| { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This code ported to Go from Stefan Gustavson's C implementation, his comments follow: | |
| * https://github.com/stegu/perlin-noise/blob/master/src/simplexnoise1234.c | |
| * SimplexNoise1234, Simplex noise with true analytic | |
| * derivative in 1D to 4D. | |
| * | |
| * Author: Stefan Gustavson, 2003-2005 | |
| * Contact: stefan.gustavson@liu.se | |
| * | |
| * | |
| * This code was GPL licensed until February 2011. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use minifb::{Key, Window, WindowOptions}; | |
| use simdnoise::NoiseBuilder; | |
| use std::{thread, time}; | |
| const WIDTH: usize = 640; | |
| const HEIGHT: usize = 640; | |
| fn main() { | |
| let mut buffer: Vec<u32> = vec![0; WIDTH * HEIGHT]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| // Experiment! draw some crazy stuff! | |
| // Gist it next week and I'll show it off on stream | |
| import ( | |
| "fmt" | |
| "github.com/veandco/go-sdl2/sdl" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace AlphaFront | |
| module JsonCustomConverters = | |
| open Newtonsoft.Json | |
| open Microsoft.FSharp.Reflection | |
| open System | |
| open System.IO | |
| type DuConverter() = | |
| inherit JsonConverter() |
NewerOlder