Skip to content

Instantly share code, notes, and snippets.

View phabee's full-sized avatar

Fabian Leuthold phabee

View GitHub Profile
@phabee
phabee / r_perf_test_3.R
Created July 18, 2018 07:26
Memory Allocation performance Test in R using statically initialized data.frames vs. dynamically growing data.frames
#' Generate random Tour
#'
#' Generates a random Tour with nrows number of stops with x/y coordinates and
#' a 4-digit random ZIP-code.
#'
#' @param nrows numeric, the number of stops
#'
#' @return data.frame, the tour
#' @export
generate_random_tour_dynamic <- function(nrows) {
@phabee
phabee / GrowingTour.java
Created July 18, 2018 06:12
Compare Growing Object Performance R vs. Java
package ch.ims.tests;
import java.util.List;
import ch.ims.core.TourGenerator;
import ch.ims.model.TourStop;
public class GrowingTour {
public static void runTest(int nLoop, int initSize) {