about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-10-08 10:04:12 +0000
committerbors <bors@rust-lang.org>2015-10-08 10:04:12 +0000
commitbcd27eb7d50978e823e61e477f2a4c2201ca34bf (patch)
tree80c3966bacd3d0f944d1c8b54136c152e2b32db3 /src/libstd/sys/unix/stack_overflow.rs
parent88898e6ca72d46a237ad6dd65e21889cdb4558a2 (diff)
parent49d2441b056719ba4c47f1fab0d864199616d3da (diff)
downloadrust-bcd27eb7d50978e823e61e477f2a4c2201ca34bf.tar.gz
rust-bcd27eb7d50978e823e61e477f2a4c2201ca34bf.zip
Auto merge of #28891 - cristicbz:new-nbody, r=alexcrichton
This new version takes inspiration from the C implementation of the benchmark, but instead of explicitly using SIMD operations which can't be done on stable, it instead arranges everything the same way and leaves the actual vectorization up to LLVM.

In addition to the ~20% speed gains (see below), this PR also adds some general niceties which showcase the language a little bit: a `Vec3` type to cut down on `(x, y, z)` repetition,  using `while let` instead of `loop-if-break`, iterator adapters instead of for loops etc.

Here are the times in seconds of 10 runs each on my workstation:

```
before: 6.254, 6.260, 6.263, 6.264, 6.265, 6.267, 6.334, 6.341, 6.441, 6.509
before-min: 6.254
before-median: 6.266
before-max: 6.509

after: 4.823, 4.824, 4.826, 4.827, 4.837, 4.839, 4.881, 4.959, 4.990, 5.377
after-min: 4.823
after-median: 4.838
after-max: 5.377

gcc: 4.674, 4.676, 4.680, 4.682, 4.695, 4.696, 4.701, 4.708, 4.794, 5.297
gcc-min: 4.674
gcc-median: 4.696
gcc-max: 5.297
```

On my i7 laptop the speed up is less impressive, from ~5.4s to ~4.7s, but still significant. On my Vultr VPS the numbers look closer to the workstation results. Surprisingly my laptop beats both office workstation and VPS...
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions