Instantly share code, notes, and snippets.

View tpbench.js
const {
openSync,
closeSync,
read,
readSync,
unlinkSync,
writeFileSync
} = require("fs");
const { tmpdir } = require("os");
const { resolve } = require("path");
View tree
deno v0.0.0 (file:///C:/Users/BertBelder/d/deno)
├── libc v0.2.42
├── log v0.4.3
│ └── cfg-if v0.1.4
├── sha1 v0.6.0
├── tempfile v3.0.3
│ ├── rand v0.5.4
│ │ ├── rand_core v0.2.1
│ │ └── winapi v0.3.5
│ ├── remove_dir_all v0.5.1
View gist:833339c2aea74da7cc7724635816f93c
snapshot_creator.exe!std::_Container_base12::_Orphan_all() Line 253
at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xutility(253)
snapshot_creator.exe!std::_String_alloc<std::_String_base_types<char,std::allocator<char> > >::_Orphan_all() Line 2007
at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xstring(2007)
snapshot_creator.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Tidy_deallocate() Line 3960
at C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.14.26428\include\xstring(3960)
snapshot_creator.exe!deno::HandleException(v8::Local<v8::Context> context={...}, v8::Local<v8::Value> exception) Line 83
at C:\Users\BertBelder\d\deno\src\binding.cc(83)
snapshot_creator.exe!deno::Execute(v8::Local<v8::Context> context={...}, const char * js_filename, const char * js_source=0x00000247c7234080) Line 226
at C:\Users\BertBelder\d\deno\src\binding.cc(226)
View gist:0103c081d3e3ccf50c1f4587212f3ecd
C:\Users\BertBelder\d\deno>python tools\build.py -v -k 0 | tee o
[1/20] C:/Python27/python.exe ../../build/toolchain/win/tool_wrapper.py asm-wrapper environment.x64 ml64.exe -DDENO_MOCK_RUNTIME -DV8_DEPRECATION_WARNINGS -DNO_TCMALLOC -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED "-DCR_CLANG_REVISION=\"335864-1\"" -D_HAS_NODISCARD -D_HAS_EXCEPTIONS=0 -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=1 -DWIN32 -D_SECURE_ATL -D_USING_V110_SDK71_ -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=0x0A000002 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DDEBUG -DV8_ENABLE_CHECKS "-DV8_EMBEDDER_STRING=\"-deno\"" -DENABLE_DISASSEMBLER -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64 -DENABLE_MINOR_MC -DOBJECT_PRINT -DVERIFY_HEAP -DV8_TRACE_MAPS -DV8_ENABLE_ALLOCATION_TIMEOUT -DV8_ENABLE_FORCE_SLOW_
View a.ts
// tslint:disable:typedef
// tslint:disable:comment-format
import * as tf from "@tensorflow/tfjs";
const DIM = 64; // Model dimensionality.
const BATCH_SIZE = 50;
const CRITIC_ITERS = 5; // How many critic iterations per generator iteration
const LAMBDA = 10; // Gradient penalty lambda hyperparameter
const ITERS = 200000; // How many generator iterations to train for
View matmul_bench.ts
import { ones } from "./index";
const t1 = ones([100, 100]);
const t2 = ones([100, 100]);
let count = 10;
let total = 0;
const begin = Date.now() / 1000;
let end = begin;
View idea.ts
let implementMe: any, math: any;
const compute = Symbol("compute");
const source = Symbol("source");
interface Computable {
[compute](): Promise<TensorBuffer>;
}
class TensorBuffer implements Computable {
View win.txt
C:\Users\BertBelder\d\x>npm install propel
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN x@1.0.0 No description
npm WARN x@1.0.0 No repository field.
+ propel@3.2.0
added 1 package in 0.422s
C:\Users\BertBelder\d\x>node -e "require('propel')"
Using DL backend.
View rb.c
#include <assert.h>
#include <malloc.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
typedef intptr_t ssize_t;
typedef struct tree_node tree_node_t;
View dump.js
var heapdump = require('heapdump');
var lastHeapUsed;
setTimeout(function() {
dump(process.memoryUsage().heapUsed);
setInterval(function() {
var heapUsed = process.memoryUsage().heapUsed;
if (heapUsed > 2*lastHeapUsed)
dump(heapUsed);