This file contains 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 { assert } from 'jsr:@std/assert' | |
const COUNT = 8 | |
const ar = [] | |
for (let i = 0; i < COUNT; ++i) { | |
ar.push({ x: Math.random() * 1000 }) | |
} | |
const sum = ar.reduce((a, obj) => (a + obj.x), 0) | |
function mapX() { |
This file contains 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
const { baseline, bench, run } = await import('https://esm.sh/mitata') | |
const data = Array.from(Array(1000).map(() => Math.random())) | |
bench('for {0;<;++} data[i]', () => { | |
let sum = 0 | |
for (let i = 0; i < data.length; ++i) { | |
sum += data[i] | |
} | |
return sum |
This file contains 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
// `extends null` isn't necessary but I prefer it. | |
class BareDataView extends null { | |
static fromBuffer(...args) { | |
// construct a new object, passing args to the DataView() constructor | |
// but use this (i.e. the BareDataView class) to set the prototype | |
return Reflect.construct(DataView, args, this) | |
} | |
} | |
// Select only the properties we actually want to expose |
This file contains 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
# list files changed by git (Added or Modified) and tidy them up in prettier | |
# xargs is a linux thing, but on Windows, can use Gow to get it. | |
git diff --name-only --diff-filter=AM | xargs -n99 prettier -uw |
This file contains 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
j = "data:text/javascript,"+encodeURIComponent(`console.log("hello from "+import.meta.url)`) | |
w = window.open("about:blank") | |
x1 = await w.eval(`import(${JSON.stringify(j)})`) | |
x2 = await w.eval(`import(${JSON.stringify(j)})`) | |
w2 = window.open("about:blank") | |
y1 = await w2.eval(`import(${JSON.stringify(j)})`) | |
y2 = await w2.eval(`import(${JSON.stringify(j)})`) |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Untitled benchmark</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script> | |
<script src="./suite.js"></script> | |
</head> | |
<body> | |
<h1>Open the console to view the results</h1> |
This file contains 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
[tool.poetry] | |
name = "Colcon" | |
version = "0.0.1" | |
description = "Workspace for editing Colcon" | |
authors = ["Dan Rose <[email protected]>"] | |
[tool.poetry.dependencies] | |
python = "^3.8" | |
colcon-argcomplete = {git = "https://github.com/colcon/colcon-argcomplete.git"} | |
colcon-bash = {git = "https://github.com/colcon/colcon-bash.git"} |
This file contains 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
PREFIX=$PWD/prefix | |
mkdir $PREFIX | |
# Fast-CDR | |
git clone https://github.com/eProsima/Fast-CDR.git | |
mkdir Fast-CDR/build && cd Fast-CDR/build | |
cmake .. -DCMAKE_INSTALL_PREFIX="$PREFIX" -DCMAKE_PREFIX_PATH="$PREFIX" | |
cmake --build . --target install | |
cd ../.. |
This file contains 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
enum Foo1 { | |
Bar1=1, | |
Baz1 | |
#ifdef _MSC_VER | |
#pragma deprecated(Baz1) | |
#else | |
__attribute__ ((deprecated("Use something else"))) | |
#endif | |
= 2, | |
Bang1=3, |
This file contains 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
repositories: | |
ament/ament_cmake: | |
type: git | |
url: https://github.com/ament/ament_cmake.git | |
version: master | |
ament/ament_index: | |
type: git | |
url: https://github.com/ament/ament_index.git | |
version: master | |
ament/ament_lint: |
NewerOlder