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 bench | |
import ( | |
"math" | |
"strconv" | |
) | |
// CPU does stuff | |
func CPU(times int) []string { | |
// Keeps it to a 32 bit 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
package main | |
import ( | |
"benchmarks/pkg/bench" | |
"fmt" | |
"net/http" | |
"runtime" | |
) | |
func helloServer(w http.ResponseWriter, r *http.Request) { |
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 http = require('http') | |
const bench = require('./bench') | |
const host = '192.168.0.14' | |
const port = 8000 | |
const start = function startServer() { | |
// Simple request router | |
const router = function requestRouter(request, reply) { | |
const result = bench(100) |
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 cpu | |
// CPU does stuff | |
func CPU(times int) []int { | |
// Keeps it to a 32 bit int | |
num := 40 | |
var r []int | |
for i := 0; i < times; i++ { | |
d := bubble(expand(reversePrime(fib(num)))) | |
r = append(r, d[len(d)-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
// ════════════════════════════════════════════════════════════════════════════════════════════════╡ | |
// const crypto = require('crypto') | |
// ════════════════════════════════════════════════════════════════════════════════════════════════╡ | |
module.exports = function CPU(times) { | |
// Keeps it to a 32 bit int | |
const num = 40 |
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 ktor.benchmark | |
/* ktlint-disable no-wildcard-imports */ | |
import io.ktor.application.* | |
import io.ktor.response.* | |
import io.ktor.request.* | |
import io.ktor.routing.* | |
import io.ktor.http.* | |
import io.ktor.locations.* | |
/* ktlint-enable no-wildcard-imports */ |
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
// Handler that calls generate | |
func ok(w http.ResponseWriter, r *http.Request) { | |
// res := make([]int64, 0, 100000) | |
var res [100000]int64 | |
fibonacci.Generate(&res) | |
// fmt.Println(suc) | |
// fmt.Printf("%T", res) | |
// fmt.Println(res[50]) | |
fmt.Fprintf(w, "OK") |
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
func fibonacci() []int { | |
var result []int | |
var start = 1000 | |
for { | |
var num = 1250 | |
var n1, n2, temp int = 0, 1, 0 | |
for { | |
temp = n2 | |
n2 = n1 + n2 |
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 cluster = require('cluster') | |
const http = require('http') | |
const numCPUs = require('os').cpus().length | |
const host = '192.168.0.14' | |
const port = 3000 | |
const start = async function startServer() { | |
// Cluster | |
if (cluster.isMaster) { |
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 http = require('http') | |
const host = '192.168.0.14' | |
const port = 3000 | |
const start = function startServer() { | |
// Simple request router | |
const router = function requestRouter(request, reply) { | |
reply.end('OK') | |
} |