Skip to content

Instantly share code, notes, and snippets.

View ViniciusMiana's full-sized avatar

Vinicius Miana ViniciusMiana

View GitHub Profile
@ViniciusMiana
ViniciusMiana / gist:955413e1adfd997c90c3
Created April 30, 2015 12:50
JSON Service With Basic Authentication
//
// JSONService.swift
// SwiftPlaces
//
// Created by Joshua Smith on 7/25/14.
// Copyright (c) 2014 iJoshSmith. All rights reserved.
//
import Foundation
@ViniciusMiana
ViniciusMiana / ListMapBench
Last active December 12, 2015 05:58
A ListMap apply benchmark. Run with: java -server -cp ...../scala/build/pack/lib/scala-library.jar -Dsize=[sizeOfListMap] -Dnreads=[numberOfCallsToApply] ListMapBench [NumberOfRunsOfTheTest]
import scala.collection.immutable.ListMap
object ListMapBench extends testing.Benchmark {
val nReads = sys.props("nreads").toInt
val size = sys.props("size").toInt
def listMap = ListMap() ++ ((0 until size) map { t => (t,t) })
def run = {
val l = listMap
var x = 0