Skip to content

Instantly share code, notes, and snippets.

@DerekZiemba
DerekZiemba / index.html
Last active December 2, 2021 22:10
JS Field access performance comparison depending on how Object constructed #jsbench #jsperf (http://jsbench.github.io/#10afe81fe96191b0c43303dedfc30f10) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>JS Field access performance comparison depending on how Object constructed #jsbench #jsperf</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>
View ThinkOrSwim.lnk
Target: "C:\Program Files\Zulu\zulu-15\bin\javaw.exe" -server -XX:VMOptionsFile="java15.vmoptions" -jar launcher-first.jar
Start in: "C:\Program Files\thinkorswim"
@DerekZiemba
DerekZiemba / Format-Json.ps1
Created September 29, 2020 23:45
Proper Powershell JSON Formatting
View Format-Json.ps1
# https://github.com/PowerShell/PowerShell/issues/2736
# https://github.com/PowerShell/PowerShell/issues/8604
function Format-Json([Parameter(Mandatory, ValueFromPipeline)]$json) {
if ($json -isnot [string]) { $json = $json | ConvertTo-Json -Depth 10; }
$indent = 0;
$lines = $json.Split("`n", [System.StringSplitOptions]::RemoveEmptyEntries);
for (($len = $lines.Length), ($i = 0); $i -lt $len; $i++) {
@DerekZiemba
DerekZiemba / Benchmark.cs
Created August 14, 2020 23:54
NBody benchmark program
View Benchmark.cs
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Runtime.InteropServices;
namespace Benchmark {
public static class Extensions {
public static string ToStringReset(this StringBuilder sb) {
@DerekZiemba
DerekZiemba / index.html
Last active July 29, 2020 23:19
HWInfo Report
View index.html
<html><head>
<meta name="GENERATOR" content="HWiNFO64 v6.28-4200">
<style>
A { text-decoration: none }
A:hover { text-decoration: underline }
TD { font: 80% verdana, tahoma, ms sans serif, arial; color: #000000; vertical-align: text-center; text-align: left }
TD.dn { font: 70% verdana, tahoma, ms sans serif, arial; color: #000000; vertical-align: text-center }
TD.di { font: bold 80% verdana, tahoma, ms sans serif, arial; color: #000000; vertical-align: text-center }
TD.ds { font: bold 80% verdana, tahoma, ms sans serif, arial; color: #000080; vertical-align: text-center }
TD.dt { font: bold 110% verdana, tahoma, ms sans serif, arial; color: #000080; vertical-align: text-center }
@DerekZiemba
DerekZiemba / index.html
Last active June 5, 2020 21:31
Javascript Fastest way to check for String Type that is not empty #jsbench #jsperf (https://jsbench.github.io/#79c073db881ec273a6ef630cfc258e49) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Javascript Fastest way to check for String Type that is not empty #jsbench #jsperf</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>
@DerekZiemba
DerekZiemba / index.html
Created May 10, 2020 01:10
Map vs Object #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Map vs Object</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>
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fast MD5 Hash</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>
@DerekZiemba
DerekZiemba / index.html
Created April 24, 2020 19:56
Javascript Property Access Performance (http://jsbench.github.io/#4ef29e47641e4fa1fdb8af48b2a7fe12) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Javascript Property Access Performance</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>
@DerekZiemba
DerekZiemba / index.html
Last active April 15, 2020 21:55
Fastest way to filter/compact array (https://jsbench.github.io/#7e604d68c13fb1b41e441a963cb9b764) #jsbench #jsperf
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>Fastest way to filter/compact array</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>