Repository Public MIT
1// =============================================================================2// SP BOUCHER | SOFTWARE & RESEARCH3// ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// PROJECT METADATA7// -----------------------------------------------------------------------------8// Project : ORIX Calc9// File : Benchmarks/Sources/orix-bench/main.swift10// Description : Runs every benchmark and prints a Markdown table of11// measured times with the machine description.12// Module : orix-bench13// Repository : https://git.spboucher.ai/orix-calc14// Created : 2026-11-2015// Last Modified : 2026-11-2016//17// =============================================================================18// AUTHOR & PROFESSIONAL AFFILIATION19// =============================================================================20//21// Author : Simon-Pierre Boucher22// Position : Professor of Finance23// Institution : Université du Québec en Outaouais (UQO)24// Department : Département des sciences administratives25// Organization : SP Boucher26//27// Website : https://spboucher.ai28// Git : https://git.spboucher.ai29//30// =============================================================================31// OFFICIAL CONTACT DIRECTORY32// =============================================================================33//34// General : info@spboucher.ai35// Professional : contact@spboucher.ai36// Direct : simon@spboucher.ai37// Research : research@spboucher.ai38// Development : dev@spboucher.ai39// Support : support@spboucher.ai40// Security/Admin : admin@spboucher.ai41// Notifications : notifications@spboucher.ai42//43// Preferred Contact: support@spboucher.ai44//45// =============================================================================46// COPYRIGHT & INTELLECTUAL PROPERTY47// =============================================================================48//49// Copyright (c) 202650// Simon-Pierre Boucher51//52// All rights reserved where applicable.53//54// This file is governed by the applicable project license,55// copyright notices, institutional agreements and relevant law.56//57// Unless expressly authorized by the applicable license or58// rights holder, copying, redistribution, sublicensing,59// publication and commercial exploitation are not permitted.60//61// Existing third-party rights and notices remain unaffected.62//63// =============================================================================64// CONFIDENTIALITY & SECURITY65// =============================================================================66//67// Classification : Public68// Distribution : Public repository; use is governed by the project license69// Security Contact : admin@spboucher.ai70//71// Access to this source does not independently grant permission72// to redistribute or disclose confidential materials.73//74// Do not embed credentials, private keys, access tokens,75// certificates or confidential personal information.76//77// =============================================================================78// LICENSE & MAINTENANCE79// =============================================================================80//81// License : Proprietary, all rights reserved (see license file)82// License File : LICENSE83// Maintainer : Simon-Pierre Boucher84// Technical Contact: dev@spboucher.ai85//86// =============================================================================87// END OF SP BOUCHER SOURCE HEADER88// =============================================================================8990import Foundation9192func sysctl(_ name: String) -> String {93 var size = 094 sysctlbyname(name, nil, &size, nil, 0)95 var buffer = [CChar](repeating: 0, count: max(size, 1))96 sysctlbyname(name, &buffer, &size, nil, 0)97 return String(cString: buffer)98}99100benchExpression()101benchWorkspace()102benchDomains()103104#if DEBUG105let configuration = "debug"106#else107let configuration = "release"108#endif109print("Machine: \(sysctl("machdep.cpu.brand_string")), \(ProcessInfo.processInfo.activeProcessorCount) cores, macOS \(ProcessInfo.processInfo.operatingSystemVersionString)")110print("Build: \(configuration), single thread, wall-clock median of repeated runs")111print("")112print("| Benchmark | Median | Best | Runs | Notes |")113print("|---|--:|--:|--:|---|")114for r in results { print("| \(r.name) | \(pretty(r.median)) | \(pretty(r.best)) | \(r.runs) | \(r.note) |") }115