This file contains hidden or 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
| #include <float.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define US_PER_MS 1000.0 | |
| typedef uint64_t(*fn_bench)(void*); | |
| /** | |
| * @param benches Array of individual benchmark functions to run. Each |
This file contains hidden or 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 bench1(numItems) { | |
| const obj = {}; | |
| for (let i = 0; i < numItems; i++) { | |
| obj[i] = 0; | |
| } | |
| let tmp; | |
| const tStart = performance.now(); | |
| for (const item of Object.values(obj)) { | |
| tmp = item; | |
| } |
This file contains hidden or 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
| /** | |
| * @param {function[]} benches - Individual benchmarks to run; each one is expected to return its execution time | |
| * @param {number} numRuns - Number of times each benchmark should be run | |
| * @param {...*} args - Arguments to pass to each benchmark | |
| */ | |
| function benchmark(benches, numRuns, ...args) { | |
| const totalTime = []; | |
| const maxTime = []; | |
| const minTime = []; | |
This file contains hidden or 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
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace Objektorientierung | |
| { | |
| class HugeInt |