Git Product home page Git Product logo

rhsort's Introduction

Array programming language user, designer, and implementer. Co-developer of Jd and former performance specialist at Dyalog. Skilled with a yo-yo. See my Github homepage for an overview of the repositories here. Also working on ngn/k at Codeberg.

rhsort's People

Contributors

mlochbaum avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rhsort's Issues

minor overflow bug

I was checking ./runwolfbench 512 0 0 1 and it crashed on rhsort. Offending code:

      for (; i<n-4; i+=4) { x[i+4] += x[i+3] += x[i+2] += x[i+1] += x[i]; }
      for (; i<n-1; i++) { x[i+1] += x[i]; }

Seemingly working fix:

      for (; i+4<n; i+=4) { x[i+4] += x[i+3] += x[i+2] += x[i+1] += x[i]; }
      for (; i+1<n; i++) { x[i+1] += x[i]; }

image

Btw, have you had any luck improving performance on the 1-31 range?

Would you be willing to benchmark agains Julia's default sorting algorithm?

@jariji shared the existence of rhsort with me here LilithHafner/InterLanguageSortingComparisons#10. I ran the benchmarks in gcc bench.c -o bench && ./bench and what I think are equivalent benchmarks in Julia. I found that Julia's default sorting is 2x faster than rhsort in that particular case. If you're willing I'd appreciate your confirmation to refutation of those results. I benchmarked Julia's sorting with this code snippet that can be pasted into the Julia REPL:

using BenchmarkTools, Random, Printf
for n in 10 .^ (3:6)
    v = rand(Int32, n)
    result = @benchmark sort($v) setup=(rand!($v)) evals=1 gctrial=false samples=3e7/n
    @printf "Testing size %8i: best: %6.3f avg: %6.3f ns/v\n" n minimum(result.times)/n mean(result.times)/n
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.