Skip to content

Commit 8920559

Browse files
committed
windows benchmark
1 parent 4493830 commit 8920559

5 files changed

Lines changed: 65 additions & 65 deletions

File tree

README.md

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -65,37 +65,9 @@ We get the shortest paths from the source node 0 to all other nodes in the graph
6565
pip install edsger
6666
```
6767

68-
### Windows Performance Optimization
69-
70-
For optimal performance on Windows, we recommend using the same GCC toolchain as SciPy:
71-
72-
#### Option 1: GCC Toolchain (Recommended)
73-
```bash
74-
# Install MinGW-w64 (see INSTALL_MINGW_WINDOWS.md for details)
75-
conda install -c conda-forge m2w64-toolchain
76-
77-
# Build with GCC (same as SciPy)
78-
git clone https://github.com/aetperf/edsger.git
79-
cd edsger
80-
pip install -e .
81-
```
82-
83-
#### Option 2: MSVC Optimizations (Fallback)
84-
```bash
85-
git clone https://github.com/aetperf/edsger.git
86-
cd edsger
87-
pip install -e .
88-
```
89-
90-
The build system automatically detects the best available compiler and applies appropriate optimizations. For more details, see [WINDOWS_OPTIMIZATION.md](WINDOWS_OPTIMIZATION.md).
91-
92-
**Performance improvement**:
93-
- **With GCC**: Target 1.4-1.6x slower than Linux (vs current 2.0x)
94-
- **With MSVC**: Up to 50% faster than unoptimized builds
95-
9668
## Why Use Edsger?
9769

98-
Edsger is designed to be **dataframe-friendly**, providing seamless integration with pandas workflows for graph algorithms. Also it is rather efficient. Our benchmarks on the USA road network (23.9M vertices, 57.7M edges) demonstrate nice performance:
70+
Edsger is designed to be **dataframe-friendly**, providing seamless integration with pandas workflows for graph algorithms. Also it is rather efficient on Linux. Our benchmarks on the USA road network (23.9M vertices, 57.7M edges) demonstrate nice performance:
9971

10072
<img src="https://raw.githubusercontent.com/aetperf/edsger/release/docs/source/assets/dijkstra_benchmark_comparison.png" alt="Dijkstra Performance Comparison" width="700">
10173

scripts/benchmark_comparison_os.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,19 @@ def save_results_json(results, system_info, network_name="USA"):
260260

261261
def main():
262262
"""Main benchmarking function."""
263+
# Determine default data directory based on OS
264+
if platform.system() == "Windows":
265+
# Check common Windows paths
266+
if os.path.exists(r"C:\Users\fpacu\Documents\Workspace\Edsger\data\DIMACS_road_networks"):
267+
default_data_dir = r"C:\Users\fpacu\Documents\Workspace\Edsger\data\DIMACS_road_networks"
268+
else:
269+
default_data_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "data", "DIMACS_road_networks")
270+
else:
271+
default_data_dir = "/home/francois/Data/DIMACS_road_networks/"
272+
273+
# Use environment variable if set, otherwise use OS-specific default
274+
default_data_dir = os.getenv("DIMACS_DATA_DIR", default_data_dir)
275+
263276
# Parse command line arguments
264277
parser = ArgumentParser(
265278
description="OS-specific benchmark comparison for Dijkstra implementations"
@@ -272,9 +285,7 @@ def main():
272285
metavar="TXT",
273286
type=str,
274287
required=False,
275-
default=os.getenv(
276-
"DIMACS_DATA_DIR", "/home/francois/Data/DIMACS_road_networks/"
277-
),
288+
default=default_data_dir,
278289
)
279290
parser.add_argument(
280291
"-n",
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"timestamp": "2025-07-13T20:33:22.859050",
2+
"timestamp": "2025-08-03T19:08:19.994943",
33
"os": "windows",
44
"network": "USA",
55
"system_info": {
@@ -8,7 +8,7 @@
88
"processor": "Intel64 Family 6 Model 183 Stepping 1, GenuineIntel",
99
"os_name": "Windows",
1010
"conda_version": "conda 25.5.1",
11-
"edsger_version": "0.1.3.post1.dev25+gdea4898",
11+
"edsger_version": "0.1.3.post1.dev28+g256802f.d20250803",
1212
"networkit_version": "11.1",
1313
"graph-tool_version": "Not available on Windows",
1414
"scipy_version": "1.16.0",
@@ -26,44 +26,44 @@
2626
{
2727
"library": "E",
2828
"times": [
29-
6.0467,
30-
6.0375,
31-
6.032,
32-
6.0342,
33-
6.0929
29+
6.8911,
30+
6.9738,
31+
6.9784,
32+
7.3171,
33+
7.1579
3434
],
35-
"min_time": 6.032,
36-
"avg_time": 6.04866,
37-
"std_time": 0.02268132271275208,
38-
"total_duration": 34.07222890853882
35+
"min_time": 6.8911,
36+
"avg_time": 7.0636600000000005,
37+
"std_time": 0.1537751943585181,
38+
"total_duration": 39.62336564064026
3939
},
4040
{
4141
"library": "NK",
4242
"times": [
43-
8.6195,
44-
8.4186,
45-
8.479,
46-
8.4975,
47-
8.4733
43+
10.0692,
44+
9.8172,
45+
9.648,
46+
9.6395,
47+
9.6392
4848
],
49-
"min_time": 8.4186,
50-
"avg_time": 8.497580000000001,
51-
"std_time": 0.06638835440045215,
52-
"total_duration": 58.735554695129395
49+
"min_time": 9.6392,
50+
"avg_time": 9.762620000000002,
51+
"std_time": 0.1676299782258532,
52+
"total_duration": 67.15296840667725
5353
},
5454
{
5555
"library": "SciPy",
5656
"times": [
57-
4.383,
58-
4.3982,
59-
4.3753,
60-
4.3974,
61-
4.3482
57+
4.8218,
58+
4.8269,
59+
4.8034,
60+
4.8575,
61+
4.8748
6262
],
63-
"min_time": 4.3482,
64-
"avg_time": 4.380420000000001,
65-
"std_time": 0.018305452739552718,
66-
"total_duration": 76.84707403182983
63+
"min_time": 4.8034,
64+
"avg_time": 4.83688,
65+
"std_time": 0.025733355785827777,
66+
"total_duration": 84.6644880771637
6767
}
6868
]
6969
}

scripts/dijkstra_dimacs.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import os
99
import sys
10+
import platform
1011
from argparse import ArgumentParser
1112
from time import perf_counter
1213

@@ -24,6 +25,19 @@
2425
)
2526
logger.add(sys.stderr, format=fmt)
2627

28+
# Determine default data directory based on OS
29+
if platform.system() == "Windows":
30+
# Check common Windows paths
31+
if os.path.exists(r"C:\Users\fpacu\Documents\Workspace\Edsger\data\DIMACS_road_networks"):
32+
default_data_dir = r"C:\Users\fpacu\Documents\Workspace\Edsger\data\DIMACS_road_networks"
33+
else:
34+
default_data_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "data", "DIMACS_road_networks")
35+
else:
36+
default_data_dir = "/home/francois/Data/DIMACS_road_networks/"
37+
38+
# Use environment variable if set, otherwise use OS-specific default
39+
default_data_dir = os.getenv("DIMACS_DATA_DIR", default_data_dir)
40+
2741
parser = ArgumentParser(description="Command line interface to dijkstra_dimacs.py")
2842
parser.add_argument(
2943
"-d",
@@ -33,7 +47,7 @@
3347
metavar="TXT",
3448
type=str,
3549
required=False,
36-
default=os.getenv("DIMACS_DATA_DIR", "/home/francois/Data/DIMACS_road_networks/"),
50+
default=default_data_dir,
3751
)
3852
parser.add_argument(
3953
"-n",

setup.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,17 @@ def detect_gcc_on_windows():
4141
os.environ["CXX"] = "g++"
4242

4343
# Use same GCC flags as Linux for consistency with SciPy
44+
# Note: Disabled LTO due to old GCC version issues
4445
extra_compile_args = [
45-
"-Ofast",
46-
"-flto",
46+
"-O3",
4747
"-march=native",
4848
"-ffast-math",
4949
"-funroll-loops",
50+
"-msse2",
51+
"-msse3",
52+
"-msse4",
5053
]
51-
extra_link_args = ["-flto"]
54+
extra_link_args = []
5255
compiler_type = "GCC"
5356
else:
5457
print("[INFO] Using MSVC toolchain on Windows")

0 commit comments

Comments
 (0)