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
/* strcmp with SSE4.2 | |
Copyright (C) 2009 Free Software Foundation, Inc. | |
Contributed by Intel Corporation. | |
This file is part of the GNU C Library. | |
The GNU C Library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public | |
License as published by the Free Software Foundation; either | |
version 2.1 of the License, or (at your option) any later version. |
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
%define EQUAL_EACH 1000b | |
%define NEGATIVE_POLARITY 010000b | |
EXPORT __strcmp_sse42 | |
mov rax, rdi | |
sub rax, rsi ; rax = rdi - rsi | |
sub rsi, 16 | |
@B: | |
add rsi, 16 |
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
#include <stdio.h> | |
#include <sys/time.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
const uint64_t count = 1000 * 1000 * 1000; | |
static uint64_t microseconds() { | |
struct timeval tv; | |
if (0 != gettimeofday(&tv, NULL)) |
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
import java.util.*; | |
class Main { | |
private static final Random random = new Random(); | |
static class A { | |
} /// end of A | |
static class B { | |
private final int hashCode = random.nextInt(); |
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
Index: build.xml | |
=================================================================== | |
--- build.xml (revision 20173) | |
+++ build.xml (working copy) | |
@@ -5,6 +5,47 @@ | |
<description> | |
SuperSabbus for Scala core, builds the scala library and compiler. It can also package it as a simple distribution, tests it for stable bootstrapping and against the Scala test suite. | |
</description> | |
+ | |
+ <target name="getjar-helper2" unless="skip.download"> |
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
<target name="getjar-helper2" unless="skip.download"> | |
<echo>Getting ${url} to ${file}</echo> | |
</target> | |
<target name="getjar-helper"> | |
<available property="skip.download" file="${file}"/> | |
<antcall target="getjar-helper2"/> | |
</target> | |
<macrodef name="getjar"> |
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
def sort(a: Array[Int]) = { | |
java.util.Arrays.sort(a) | |
} | |
def profile[T](what: String)(action: => T) = { | |
val start = System.currentTimeMillis() | |
val r = action | |
val delta = System.currentTimeMillis() - start | |
println(what + ": " + delta + "; " + r) | |
} |
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
#include <sys/time.h> | |
#include <time.h> | |
#include <stdlib.h> | |
#include <vector> | |
#include <iostream> | |
#include <algorithm> | |
using namespace std; |
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
case class A(value: Int) | |
def sort(a: java.util.List[A]) = { | |
val c = new java.util.Comparator[A] { | |
override def compare(x: A, y: A) = x.value - y.value | |
} | |
java.util.Collections.sort(a, c) | |
} | |
def profile[T](what: String)(action: => T) = { |
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
def profile[T](what: String)(action: => T) = { | |
val start = System.currentTimeMillis() | |
val r = action | |
val delta = System.currentTimeMillis() - start | |
println(what + ": " + delta + "; " + r) | |
} |