-
-
Save vojtamolda/7225a6494a88921e7dc01100f5a64177 to your computer and use it in GitHub Desktop.
Simple Benchmark of Summation in C and Swift
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"# Simple Benchmark of Summation in C and Swift" | |
], | |
"metadata": { | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
} | |
} | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"## Benchmarking\n", | |
"\n", | |
"Compile and benchmark optimized C and Swift apps." | |
], | |
"metadata": { | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
} | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"! clang -O3 main.c -o c.app\n", | |
"! ./c.app > c.csv\n", | |
"\n", | |
"! swiftc main.swift -O -o swift.app\n", | |
"! ./swift.app > swift.csv" | |
], | |
"outputs": [], | |
"execution_count": 1, | |
"metadata": { | |
"collapsed": true, | |
"outputExpanded": false, | |
"jupyter": { | |
"source_hidden": false, | |
"outputs_hidden": false | |
}, | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
}, | |
"execution": { | |
"iopub.status.busy": "2020-05-07T21:39:35.641Z", | |
"iopub.execute_input": "2020-05-07T21:39:35.643Z", | |
"iopub.status.idle": "2020-05-07T21:39:37.208Z", | |
"shell.execute_reply": "2020-05-07T21:39:37.220Z" | |
} | |
} | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"Load the benchmark data as Pandas `DataFrame`." | |
], | |
"metadata": { | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
} | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"import matplotlib.pyplot as mpl\n", | |
"import pandas as pd" | |
], | |
"outputs": [], | |
"execution_count": 2, | |
"metadata": { | |
"collapsed": true, | |
"outputExpanded": false, | |
"jupyter": { | |
"source_hidden": false, | |
"outputs_hidden": false | |
}, | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
}, | |
"execution": { | |
"iopub.status.busy": "2020-05-07T21:40:30.269Z", | |
"iopub.execute_input": "2020-05-07T21:40:30.272Z", | |
"iopub.status.idle": "2020-05-07T21:40:30.277Z", | |
"shell.execute_reply": "2020-05-07T21:40:30.281Z" | |
} | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"c = pd.read_csv(\"c.csv\", delimiter=\" \", usecols=[0], names=[\"execution_time\"])\n", | |
"swift = pd.read_csv(\"swift.csv\", delimiter=\" \", usecols=[0], names=[\"execution_time\"])\n", | |
"\n", | |
"time = pd.concat([c, swift], keys=[\"c\", \"swift\"], axis=1)\n", | |
"time.T" | |
], | |
"outputs": [ | |
{ | |
"output_type": "execute_result", | |
"execution_count": 3, | |
"data": { | |
"text/plain": [ | |
" 0 1 2 3 4 5 6 7 \\\n", | |
"c execution_time 0.288 0.152 0.148 0.148 0.149 0.149 0.149 0.147 \n", | |
"swift execution_time 0.249 0.154 0.149 0.147 0.147 0.147 0.147 0.147 \n", | |
"\n", | |
" 8 9 10 11 12 13 14 \n", | |
"c execution_time 0.149 0.151 0.148 0.148 0.149 0.149 0.148 \n", | |
"swift execution_time 0.150 0.149 0.147 0.149 0.150 0.148 0.147 " | |
], | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th></th>\n", | |
" <th>0</th>\n", | |
" <th>1</th>\n", | |
" <th>2</th>\n", | |
" <th>3</th>\n", | |
" <th>4</th>\n", | |
" <th>5</th>\n", | |
" <th>6</th>\n", | |
" <th>7</th>\n", | |
" <th>8</th>\n", | |
" <th>9</th>\n", | |
" <th>10</th>\n", | |
" <th>11</th>\n", | |
" <th>12</th>\n", | |
" <th>13</th>\n", | |
" <th>14</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>c</th>\n", | |
" <th>execution_time</th>\n", | |
" <td>0.288</td>\n", | |
" <td>0.152</td>\n", | |
" <td>0.148</td>\n", | |
" <td>0.148</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.147</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.151</td>\n", | |
" <td>0.148</td>\n", | |
" <td>0.148</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.148</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>swift</th>\n", | |
" <th>execution_time</th>\n", | |
" <td>0.249</td>\n", | |
" <td>0.154</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.147</td>\n", | |
" <td>0.147</td>\n", | |
" <td>0.147</td>\n", | |
" <td>0.147</td>\n", | |
" <td>0.147</td>\n", | |
" <td>0.150</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.147</td>\n", | |
" <td>0.149</td>\n", | |
" <td>0.150</td>\n", | |
" <td>0.148</td>\n", | |
" <td>0.147</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
] | |
}, | |
"metadata": {} | |
} | |
], | |
"execution_count": 3, | |
"metadata": { | |
"collapsed": true, | |
"outputExpanded": false, | |
"jupyter": { | |
"source_hidden": false, | |
"outputs_hidden": false | |
}, | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
}, | |
"execution": { | |
"iopub.status.busy": "2020-05-07T21:40:31.977Z", | |
"iopub.execute_input": "2020-05-07T21:40:31.979Z", | |
"iopub.status.idle": "2020-05-07T21:40:31.998Z", | |
"shell.execute_reply": "2020-05-07T21:40:32.001Z" | |
} | |
} | |
}, | |
{ | |
"cell_type": "markdown", | |
"source": [ | |
"## Results\n", | |
"\n", | |
"Executed on 2019 MacBook Pro 16\" 2.6 GHz Intel 6-Core i7." | |
], | |
"metadata": { | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
} | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"time_mean = time.mean()\n", | |
"time_std = time.std()\n", | |
"\n", | |
"time_mean.plot.barh(title=\"Absolute Execution Time [ms]\", xerr=time_std);" | |
], | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
], | |
"image/png": [ | |
"iVBORw0KGgoAAAANSUhEUgAAAd4AAAEICAYAAADx+ZXxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAbPklEQVR4nO3debhdVX3/8ffHAEEBGQyUQUtEsS1IRQVF6wDWSoVWsOJQUVFQW1pt1WLFaidra/z5+xVttQ8qCiqliv7EWlERWwNWRZtAmFSUIYpMMgsig+HbP/a6crjcJDf33qyTkPfrec5z97j2d697ks/Za++cpKqQJEl9PGDcBUiStCExeCVJ6sjglSSpI4NXkqSODF5JkjoyeCVJ6sjglSSpI4NXWguSnJDk7XPc5suT/Pdctrk+S3Jhkn07H/MLSQ7rcJy/SXJXkluTbDbHbR/R2q0kj5zLtjU9Bq80C0kWJ7kxyfxx1zJqtiHd9l/R/oIefe04l3WuQT33+SBTVbtX1eI5Ps6FI+e6IsntI/N/UVXPrqqPzOUxV+ETVbV5Vf10Lhutqg9V1eZz2abWzEbjLkBaXyVZCDwVuBl4DvDJcdazFnyjqp4y7iJ6qqrdJ6aTLAZOrKrjxleR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PHT1Hlr4jaHG57UalgFnA7870uZewAWtzffSvjluTL/rfYGzJrU3jn7cm+G+2E8ZrsIuHNn38Fb7xQzDuOPqxylrBF4C3DXp/bhnW/dfwPmtzhOBzcdU45NbHee2n0eMtLlLe19c3N4n88f4u17I8EHwAZPa7N2PXwauGfl9fnZtvB/9ykhJkjryHq8kSR0ZvJIkdWTwSpLUkcErSVJHBq8kSR0ZvJIkdWTwSpLU0f8C4d17NB3AwQIAAAAASUVORK5CYII=\n" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
} | |
} | |
], | |
"execution_count": 4, | |
"metadata": { | |
"collapsed": true, | |
"outputExpanded": false, | |
"jupyter": { | |
"source_hidden": false, | |
"outputs_hidden": false | |
}, | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
}, | |
"execution": { | |
"iopub.status.busy": "2020-05-07T21:40:34.287Z", | |
"iopub.execute_input": "2020-05-07T21:40:34.290Z", | |
"iopub.status.idle": "2020-05-07T21:40:34.427Z", | |
"shell.execute_reply": "2020-05-07T21:40:34.432Z" | |
} | |
} | |
}, | |
{ | |
"cell_type": "code", | |
"source": [ | |
"relative_mean = (time.mean() / time.mean().max() * 100)\n", | |
"relative_std = (time.std() / time.mean().max() * 100)\n", | |
"\n", | |
"relative_mean.plot.barh(title=\"Relative Execution Time\", xerr=relative_std);" | |
], | |
"outputs": [ | |
{ | |
"output_type": "display_data", | |
"data": { | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
], | |
"image/png": [ | |
"iVBORw0KGgoAAAANSUhEUgAAAdYAAAEICAYAAADiLtUFAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4yLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+j8jraAAAYhklEQVR4nO3de7zu9Zz38dfb3tmpTEmhtsOWwh2RxOQcY1Ch3JPbIY0Uze0xThHCjBmN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x7Z8Z+CakQ+K+XSN7g1cBRzZpraPSLIx8/T6VNXPgXcAFzME6rXACubv9Rk11TWZ758R+wNfae/ntC8Gq+a1JJsA/wm8oqp+Pbqthr8lmxd/T5bkqcCVVbVi3G3pZCGwE/AfVfUQ4LesNO07z67PnRhGPfcGtgY25s+nIee9+XRNppPkDQy3iz4+jvoN1vXXz4F7jCzfva2bN5JswBCqH6+qY9vqKyamq9rPK8fVvll6FPD0JBcxTMs/geEe5WZt6hHm1zX6GfCzqjqtLR/DELTz9fo8Ebiwqq6qqpuAYxmu2Xy9PqOmuibz8jMiyX7AU4F96tYvapjTvhis66/vAtu1pxpvz3Bj//gxt2nG2v3HDwHfr6p3jmw6Hnh+e/984PNz3bbVUVWvq6q7V9UShmvxX1W1D3AysHfbbT7153LgkiT3a6v+Cvge8/T6MEwB75Jko/Zvb6I/8/L6rGSqa3I88Lft6eBdgGtHpozXSUmewnA75elVdf3IpuOBZydZlOTeDA9kfWetNaSqfK2nL2B3hifnfgy8YdztmWXbH80wZXU2cGZ77c5wX/LrwI+Ak4DNx93W1ejbrsAX2/tt2gfABcBngUXjbt8s+rEjsLxdo+OAO83n6wO8CfgBcC7wMWDRfLs+wCcZ7hHfxDCrcMBU1wQIw18O/Bg4h+GJ6LH3YRV9uYDhXurEZ8LhI/u/ofXlfGC3tdk2v9JQkqSOnAqWJKkjg1WSpI4MVkmSOjJYJUnqyGCVJKkjg1WSpI4MVkmSOvr/hOFKaeoXls0AAAAASUVORK5CYII=\n" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
} | |
} | |
], | |
"execution_count": 5, | |
"metadata": { | |
"collapsed": true, | |
"outputExpanded": false, | |
"jupyter": { | |
"source_hidden": false, | |
"outputs_hidden": false | |
}, | |
"nteract": { | |
"transient": { | |
"deleting": false | |
} | |
}, | |
"execution": { | |
"iopub.status.busy": "2020-05-07T21:40:37.328Z", | |
"iopub.execute_input": "2020-05-07T21:40:37.332Z", | |
"iopub.status.idle": "2020-05-07T21:40:37.454Z", | |
"shell.execute_reply": "2020-05-07T21:40:37.457Z" | |
} | |
} | |
} | |
], | |
"metadata": { | |
"kernel_info": { | |
"name": "python3" | |
}, | |
"language_info": { | |
"name": "python", | |
"version": "3.7.3", | |
"mimetype": "text/x-python", | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"pygments_lexer": "ipython3", | |
"nbconvert_exporter": "python", | |
"file_extension": ".py" | |
}, | |
"kernelspec": { | |
"argv": [ | |
"/Users/Vojta/Desktop/Summation Benchmark/Python/bin/python", | |
"-m", | |
"ipykernel_launcher", | |
"-f", | |
"{connection_file}" | |
], | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"nteract": { | |
"version": "0.23.1" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 0 | |
} |
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
#include <time.h> | |
#include <stdio.h> | |
int main () { | |
const int N = 300000; | |
int64_t buffer[N]; | |
for (int test = 0; test < 15; test++) { | |
clock_t start = clock(); | |
for (int i = 0; i < N; i++) { | |
buffer[i] = test; | |
} | |
int64_t sum = 0; | |
for (int i = 0; i < N; i++) { | |
sum += buffer[i]; | |
} | |
printf("%.3f ms %llu\n", ((double)(clock() - start)) / CLOCKS_PER_SEC * 1000, sum); | |
} | |
return 0; | |
} |
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
import Foundation | |
let N = 300_000 | |
var buffer = [Int64](repeating: 0, count: N) | |
for test: Int64 in 0 ..< 15 { | |
let start = Date() | |
buffer.withUnsafeMutableBufferPointer { buffer in | |
for i in 0 ..< N { | |
buffer[i] = test | |
} | |
} | |
let sum = buffer.reduce(0, &+) | |
print("\(String(format: "%.3f", Date().timeIntervalSince(start) * 1_000)) ms \(sum)") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment