Skip to content

Commit

Permalink
Add Scala.js LICENSE file and a cool license header
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Fonseca committed Oct 26, 2013
1 parent 57d1bcb commit 8076152
Show file tree
Hide file tree
Showing 25 changed files with 222 additions and 35 deletions.
27 changes: 27 additions & 0 deletions LICENSE
@@ -0,0 +1,27 @@
Copyright (c) 2013 EPFL

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the EPFL nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -7,6 +7,11 @@ This is a port of the Dart
You can see the benchmarks in action
[here](http://jonas.github.io/scalajs-benchmarks/).

All derivative work is the copyright of their respective authors and
distributed under their original license. All original work unless otherwise
stated is distributed under the [same license as
Scala.js](https://github.com/jonas/scalajs-benchmarks/LICENSE).

## Get started

To run the benchmarks, first install the Scala.js compiler by following the
Expand Down
12 changes: 6 additions & 6 deletions common/Benchmark.scala
@@ -1,16 +1,16 @@
/* __ *\
** ________ ___ / / ___ Scala API **
** / __/ __// _ | / / / _ | (c) 2003-2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ **
** /____/\___/_/ |_/____/_/ | | **
** |/ **
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2003-2013, LAMP/EPFL **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ (c) 2013, Jonas Fonseca **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **

This comment has been minimized.

Copy link
@sjrd

sjrd Oct 26, 2013

Contributor

Oh nice! I'll reuse that ASCII art, if you don't mind :-)

This comment has been minimized.

Copy link
@jonas

jonas via email Oct 27, 2013

Owner
\* */

package benchmarks

import scala.compat.Platform

/** `Benchmark` base class based on the deprecated scala.test.Benchmark.
/** `Benchmark` base class based on the deprecated scala.testing.Benchmark.
*
* The `run` method has to be defined by the user, who will perform the
* timed operation there.
Expand Down
7 changes: 7 additions & 0 deletions common/benchmark-runner.sh
@@ -1,5 +1,12 @@
#!/bin/sh
# __
# ________ ___ / / ___ __ ____ Scala.js Benchmarks
# / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca
# __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \
# /____/\___/_/ |_/____/_/ | |__/ /____/
# |/____/
#

# Run a benchmark against a JavaScript VM.

# set -x
Expand Down
15 changes: 10 additions & 5 deletions common/d8-stubs.js
@@ -1,10 +1,15 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

/*
* Scala.js Benchmarks - Stubs for running benchmarks in d8.
*
* d8 is a tool included with V8:
* https://code.google.com/p/v8/
* Stubs for running benchmarks in d8.
*
* Author: Jonas Fonseca
* d8 is a tool included with V8: https://code.google.com/p/v8/
*/

this['console'] = {};
Expand Down
12 changes: 9 additions & 3 deletions common/node-stubs.js
@@ -1,7 +1,13 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

/*
* Scala.js Benchmarks - Stubs for running benchmarks in node.js.
*
* Author: Jonas Fonseca
* Stubs for running benchmarks in node.js.
*/

/* In node.js, the global object is not exposed via 'this'
Expand Down
11 changes: 9 additions & 2 deletions common/start-benchmark.js
@@ -1,6 +1,13 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

/*
* Scala.js Benchmarks - Run one or more benchmarks.
* Author: Jonas Fonseca
* Run one or more benchmarks.
*/

this['ScalaJSBenchmarks'].forEach(function(benchmark) {
Expand Down
8 changes: 8 additions & 0 deletions deltablue/DeltaBlue.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

// Copyright 2011 Google Inc. All Rights Reserved.
// Copyright 1996 John Maloney and Mario Wolczko
//
Expand Down
14 changes: 11 additions & 3 deletions deltablue/exports.js
@@ -1,8 +1,16 @@
/* Scala.js benchmark
* Public domain
* Author: Jonas Fonseca
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

/*
* Export benchmarks to be run by common/start-benchmark.js.
*/

// Allow to override Scala.js' global object.
if (typeof(this['__scalajs_benchmarks_global']) === 'object') {
ScalaJS.g = this['__scalajs_benchmarks_global'];
}
Expand Down
7 changes: 7 additions & 0 deletions deltablue/run.sh
@@ -1,4 +1,11 @@
#!/bin/sh
# __
# ________ ___ / / ___ __ ____ Scala.js Benchmarks
# / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca
# __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \
# /____/\___/_/ |_/____/_/ | |__/ /____/
# |/____/
#

. "$(dirname "$0")/../common/benchmark-runner.sh"

Expand Down
8 changes: 8 additions & 0 deletions richards/Richards.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

// Copyright 2006-2008 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
Expand Down
14 changes: 11 additions & 3 deletions richards/exports.js
@@ -1,8 +1,16 @@
/* Scala.js benchmark
* Public domain
* Author: Jonas Fonseca
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

/*
* Export benchmarks to be run by common/start-benchmark.js.
*/

// Allow to override Scala.js' global object.
if (typeof(this['__scalajs_benchmarks_global']) === 'object') {
ScalaJS.g = this['__scalajs_benchmarks_global'];
}
Expand Down
7 changes: 7 additions & 0 deletions richards/run.sh
@@ -1,4 +1,11 @@
#!/bin/sh
# __
# ________ ___ / / ___ __ ____ Scala.js Benchmarks
# / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca
# __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \
# /____/\___/_/ |_/____/_/ | |__/ /____/
# |/____/
#

. "$(dirname "$0")/../common/benchmark-runner.sh"

Expand Down
8 changes: 8 additions & 0 deletions tracer/App.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

package benchmarks.tracer

import scala.js
Expand Down
8 changes: 8 additions & 0 deletions tracer/Color.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */

// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
Expand Down
8 changes: 8 additions & 0 deletions tracer/Engine.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */

// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
Expand Down
11 changes: 7 additions & 4 deletions tracer/JSTypes.scala
@@ -1,7 +1,10 @@
/* Scala.js example code
* Public domain
* @author Sébastien Doeraene
*/
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ Sébastien Doeraene **
** /____/\___/_/ |_/____/_/ | |__/ /____/ Public domain **
** |/____/ **
\* */

package benchmarks.tracer

Expand Down
8 changes: 8 additions & 0 deletions tracer/Material.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */

// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
Expand Down
8 changes: 8 additions & 0 deletions tracer/RenderScene.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */

// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
Expand Down
8 changes: 8 additions & 0 deletions tracer/Scene.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */

// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
Expand Down
8 changes: 8 additions & 0 deletions tracer/Shapes.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */

// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
Expand Down
8 changes: 8 additions & 0 deletions tracer/Tracer.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */

// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
Expand Down
14 changes: 8 additions & 6 deletions tracer/Vector.scala
@@ -1,3 +1,11 @@
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ Adam Burmister **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ 2012, Google, Inc **
** /____/\___/_/ |_/____/_/ | |__/ /____/ 2013, Jonas Fonseca **
** |/____/ **
\* */

// The ray tracer code in this file is written by Adam Burmister. It
// is available in its original form from:
//
Expand All @@ -9,12 +17,6 @@ package benchmarks.tracer

class Vector(val x: Double, val y: Double, val z: Double) {

// def copy(Vector v): Vector = {
// this.x = v.x;
// this.y = v.y;
// this.z = v.z;
// }

def normalize: Vector = {
val m = this.magnitude
new Vector(x / m, y / m, z / m)
Expand Down
14 changes: 11 additions & 3 deletions tracer/exports.js
@@ -1,8 +1,16 @@
/* Scala.js benchmark
* Public domain
* Author: Jonas Fonseca
/* __ *\
** ________ ___ / / ___ __ ____ Scala.js Benchmarks **
** / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca **
** __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \ **
** /____/\___/_/ |_/____/_/ | |__/ /____/ **
** |/____/ **
\* */

/*
* Export benchmarks to be run by common/start-benchmark.js.
*/

// Allow to override Scala.js' global object.
if (typeof(this['__scalajs_benchmarks_global']) === 'object') {
ScalaJS.g = this['__scalajs_benchmarks_global'];
}
Expand Down
7 changes: 7 additions & 0 deletions tracer/run.sh
@@ -1,4 +1,11 @@
#!/bin/sh
# __
# ________ ___ / / ___ __ ____ Scala.js Benchmarks
# / __/ __// _ | / / / _ | __ / // __/ (c) 2013, Jonas Fonseca
# __\ \/ /__/ __ |/ /__/ __ |/_// /_\ \
# /____/\___/_/ |_/____/_/ | |__/ /____/
# |/____/
#

. "$(dirname "$0")/../common/benchmark-runner.sh"

Expand Down

0 comments on commit 8076152

Please sign in to comment.