- Построить синтаксическое дерево из строки шаблона
- Скомпилировать программу с учетом переданных разделителей S
- (A) Пусть
N
- дерево, результат п.1 - (F) Скопмилировать
N
- Если
N
этоnodePattern
- Обойти дочерние элементы. Пусть
M
это список программ- Взять следующий дочерний узел
N
; - Пусть
P
это результат применения (A) кN
; - Пусть
P'
это результат применения оптмизаций кP
- Взять следующий дочерний узел
- Обойти дочерние элементы. Пусть
- Если
- (A) Пусть
- Положить
P'
вM
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
type ring struct { | |
data []byte | |
size int | |
pos int | |
len int | |
} | |
func newRing(size int) *ring { | |
return &ring{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Find in linked list</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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>UUID</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
var inherits = require("inherits-js"); | |
var Generator; | |
/** | |
* @abstract | |
* @class Generator | |
* @constructor | |
*/ | |
Generator = function() { | |
var self = this; |
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
package gcd | |
import "fmt" | |
import "math/big" | |
func Dedup(l []int64) []int64 { | |
list := make([]int64, len(l)) | |
copy(list, l) | |
last := len(list) - 1 |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
type List struct { | |
Items []int | |
} |
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
function Actor(min, max) { | |
var self = this; | |
this.id = Math.floor(min + Math.random() * (max - min + 1)); | |
var actor = function() { return self.action.apply(actor, arguments); } | |
Object.setPrototypeOf(actor, this); | |
return actor; | |
} |
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
var bigInt = 1000000000; | |
console.log(process.argv); | |
function asBuf() { | |
var buf = new Buffer(""); | |
for (var i = 0; i < bigInt; i++) { | |
if (i % 10000 == 0) console.log(process.memoryUsage()['rss'] / 1024 / 1024 + 'mb'); | |
buf = Buffer.concat([buf, new Buffer("a")]); |