Skip to content

Instantly share code, notes, and snippets.

import { perfContext, before, ThroughputRuntimeCase } from '..';
//import * as xterm from 'xterm';
import { Terminal as TerminalType } from 'xterm/src/Terminal';
const Terminal: typeof TerminalType = require('xterm/lib/Terminal').Terminal;
const pty = require('xterm/node_modules/node-pty');
class TestTerminal extends Terminal {
writeSync(data: string) {
this.writeBuffer.push(data);
const Terminal = require('xterm/lib/Terminal').Terminal;
const pty = require('xterm/node_modules/node-pty');
const perfContext = require('../lib/index').perfContext;
const before = require('../lib/index').before;
const RuntimeCase = require('../lib/index').RuntimeCase;
class TestTerminal extends Terminal {
writeSync(data) {
this.writeBuffer.push(data);
this._innerWrite();
const fs = require('fs');
const Terminal = require('./lib/Terminal').Terminal;
class TestTerminal extends Terminal {
writeSync(data) {
this.writeBuffer.push(data);
this._innerWrite();
}
}
@jerch
jerch / idea.ts
Last active August 29, 2018 18:21
type CharDataNew = [
number, // flags 1 - current flags
number, // flags 2 - store missing RGB values
number // content - UTF32 char or pointer to combined string (at the end of the memory)
]
type SomeType = null; // to be implmented
/**
* memory layout:
var os = require('os');
var pty = require('./lib/index');
var shell = os.platform() === 'win32'
? 'powershell.exe'
: 'bash';
process.on('exit', function(c) {
console.log('exit ' + c)
});
<!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>
@jerch
jerch / test.ts
Created August 1, 2018 08:00
array search vs LLRB
const enum AttributeEntry {
FG = 0,
BG = 1
}
const enum FLAGS {
BOLD = 1,
UNDERLINE = 2,
BLINK = 4,
INVERSE = 8,
<!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>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>array vs typed vs asm</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>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>typed vs normal - INC</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>