Skip to content

Instantly share code, notes, and snippets.

View jackmott's full-sized avatar

Jack Mott jackmott

  • Olo
  • Texas,USA
View GitHub Profile
@jackmott
jackmott / NaiveGame.cs
Created September 5, 2016 18:35
Naive CSharp Game
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;
namespace csharpclarity
{
class Vector
{
public float x, y, z;
@jackmott
jackmott / NaiveJavaGame.java
Created September 5, 2016 18:50
Naive Java Game
class Vector
{
public float x, y, z;
public Vector(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
@jackmott
jackmott / MyBenchmark.java
Last active September 6, 2016 13:59
JavaBench
package org.sample;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
@jackmott
jackmott / Speed.java
Created September 8, 2016 12:31
morejavatest
import java.util.concurrent.TimeUnit;
import java.util.Arrays;
import java.util.Random;
import java.lang.*;
public class Speed {
public static void main(String[] args) {
package org.sample;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.Scope;
import org.openjdk.jmh.annotations.State;
import org.openjdk.jmh.annotations.Setup;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
@jackmott
jackmott / FasterGame.cs
Last active August 21, 2020 18:17
Faster CSharp Game
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Threading;
namespace bettercraft
{
@jackmott
jackmott / FasterGame.java
Last active September 12, 2016 01:21
Faster Java Game
class Vector
{
public float x, y, z;
public Vector(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
@jackmott
jackmott / NaiveGame.cpp
Created September 8, 2016 14:58
Naive C++ Game
// clarity.cpp : Defines the entry point for the console application.
//
#include <stdio.h>
#include <stdlib.h>
#include <chrono>
#include <thread>
#include <math.h>
#include <string>
#include <vector>
@jackmott
jackmott / FasterGame.cpp
Last active March 5, 2017 03:56
Faster Game CPP
#include <cstdio>
#include <cstdlib>
#include <chrono>
#include <thread>
#include <cmath>
#include <string>
#include <vector>
#include <array>
@jackmott
jackmott / NaiveRust.rs
Last active September 12, 2016 15:55
Naive Rust Game
// Implementation contributed by https://github.com/Maplicant
// Optimized game implementation in Rust
extern crate time;
use time::precise_time_ns;
use std::ops::{Add, Sub, Mul};
static NUM_BLOCKS: usize = 65535;
static NUM_ENTITIES: usize = 1000;
static CHUNK_COUNT: usize = 100;