Skip to content

Instantly share code, notes, and snippets.

View komamitsu's full-sized avatar

Mitsunori Komatsu komamitsu

View GitHub Profile
@komamitsu
komamitsu / gist:0d67813f20904bd05dc93cf036cd5ab5
Last active March 25, 2018 16:28
Performance and memory footprint comparison for set collections
package org.komamitsu.test;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import it.unimi.dsi.fastutil.objects.ObjectSets;
import org.eclipse.collections.api.factory.set.MutableSetFactory;
import org.eclipse.collections.api.set.MutableSet;
import org.eclipse.collections.impl.set.mutable.UnifiedSet;
import org.trie4j.doublearray.DoubleArray;
import org.trie4j.patricia.PatriciaTrie;
@komamitsu
komamitsu / JavaLambdaTest.java
Last active October 15, 2017 15:26
Lambda comparison between Java and Kotlin
public class JavaLambdaTest
{
public int i;
public void runTask(Runnable f)
{
f.run();
}
public void run()
package org.komamitsu.test;
import org.codehaus.commons.compiler.CompilerFactoryFactory;
import org.codehaus.commons.compiler.IClassBodyEvaluator;
import java.lang.reflect.Method;
public class JaninoExample
{
public int add(int a, int b)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MeScript : MonoBehaviour {
void Update() {
transform.Rotate(0, Input.GetAxis("Horizontal") * 60 * Time.deltaTime, 0);
transform.Translate(Vector3.forward * Input.GetAxis("Vertical") * 0.2f, Space.Self);
}

LSNs

  • VCL

    • Volume Complete LSN
    • Guarantee availability of all prior log records
    • During storage recovery, every log record with an LSN larger than the VCL must be truncated
  • VDL

    • Volume Durable LSN
  • Consistency Point LSNs

2.7.1
[info] Test org.msgpack.jackson.dataformat.benchmark.MessagePackDataformatHugeDataBenchmarkTest.testBenchmark started
serialize(huge) with JSON:
mean : 28.948
min : 28.728
max : 29.139
stdev: 0.180
serialize(huge) with MessagePack:
mean : 31.686
thread 'main' panicked at 'called `Result::unwrap()` on
an `Err` value: JsonDecodeError(ApplicationError("Could not parse \'2017-04-24T14:33:43Z\' as a TimeStamp."))',src/libcore/result.rs:859
public static void main(String[] args)
throws IOException
{
DoubleArrayTrie da = new DoubleArrayTrie();
List<String> lines = new ArrayList<>();
try (BufferedReader reader = new BufferedReader(new FileReader("/Users/komamitsu/tmp/sorted_uuids"))) {
String line;
while ((line = reader.readLine()) != null) {
lines.add(line);
}
// cc -c dartest.cpp && c++ -o dartest dartest.o
#include <chrono>
#include <iostream>
#include <string>
#include <algorithm>
#include <fstream>
#include <darts.h>
using namespace std;
require 'minecraft-pi-ruby'
N = 41
xs = []
(N + 2).times do |y|
xs[y] = ' ' * (N + 2)
end