[{"data":1,"prerenderedAt":392},["ShallowReactive",2],{"project-34646199":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":35,"aspects":36,"strip":43,"post_text":45,"what":46,"said":81,"maker_in_thread":173,"shape":184,"grid":189,"attempts":354,"same_week":355,"maker_shows":38,"maker_hidden":384,"reader_version":385,"card":386},"34646199","Glidesort","A new stable sort in Rust up to ~4x faster for random data","title","Show HN: Glidesort, a new stable sort in Rust up to ~4x faster for random data","https:\u002F\u002Fgithub.com\u002Forlp\u002Fglidesort","github.com","orlp",1675450845,2023,389,70,85,3109,3,"legend","languages","sorting library","library",[24,25,26,27],"stable sort","rust sort","quicksort","merge sort","curious",0.196,{"positive":31,"neutral":32,"mixed":33,"critical":34},7,17,0,4,28,{"performance":37,"execution":39,"idea":40,"docs":42},{"positive":38,"critical":18},1,{"positive":33,"critical":38},{"positive":41,"critical":33},2,{"positive":38,"critical":33},[38,38,18,33,33,33,18,18,18,33,33,38,33,44,33,33,33,33,33,18,33,38,33,44,33,18,18,44,33,18,18,18,18,44,44,18,33,33,44,44],5,"Hi all, I've talked about glidesort a few times on HN already, but it's finally ready for release. If you have any questions, feel free to ask. An academic paper on glidesort that goes into a lot more detail than the readme is upcoming, but is not ready yet.\n\nI will be giving a talk on glidesort tomorrow at FOSDEM 2023 in the Rust Devroom at 16:10, you can seek me out there as well.",{"problem":47,"audience":63,"pricing":63,"motivation":63,"time_to_build":63,"stack":64,"openness":78,"stage":79,"team_size":80},{"value":48,"source":49,"evidence":50},"Provides a fast stable sort that can use configurable, small auxiliary memory","maker",[51,54,58,61],{"id":52,"by":11,"text":53},"34647038","The allocation always happens once, at the start of the algorithm. The default allocation size is hard to describe in plain English, whereas the code is quite readable: ``` const…",{"id":55,"by":56,"text":57},"34647556","10000truths","I'm interested in seeing a comparison with blitsort. Like glidesort, it's stable, adaptive, and can be configured to use constant auxiliary memory.",{"id":59,"by":11,"text":60},"34647631","I haven't done a comparison yet (because I haven't gotten to really benchmarking the low-memory performance), but I will include it in the paper. The fact that glidesort can use…",{"id":62},"post",null,[65,72],{"value":66,"source":49,"evidence":67},"Rust",[68,69],{"id":62},{"id":70,"by":11,"text":71},"34647089","Not yet. I do aim to have open code for a benchmark including pdqsort, fluxsort, etc, accompanying my upcoming paper on glidesort. This would be in a separate repository. That…",{"value":73,"source":49,"evidence":74},"Specialization (nightly, unstable feature)",[75],{"id":76,"by":11,"text":77},"34648665","Try running with the latest nightly Rust (`rustup update nightly`) and with `cargo build --release --features unstable`. To get the best performance I use specialization for Copy…","open_source","launched","unknown",{"praise":82,"objections":99,"requests":121,"questions":140,"alternatives":155},[83,92],{"value":84,"source":85,"evidence":86},"Interesting adaptive, low-memory design","commenter",[87,91],{"id":88,"by":89,"text":90},"34646938","timerol","The ability to work with different memory sizes is pretty intriguing. How does the algorithm decide where and when to allocate?",{"id":55,"by":56,"text":57},{"value":93,"source":85,"evidence":94},"Strong benchmark results, especially on newer hardware",[95],{"id":96,"by":97,"text":98},"34649157","mlochbaum","Makes sense regarding instruction-level parallelism; someone else with an M2 measured and found performance near identical to fluxsort. What did you take those results on?…",[100,109],{"value":101,"source":85,"evidence":102},"Slower than fluxsort on older Intel machines in independent benchmarks",[103,106],{"id":104,"by":97,"text":105},"34648864","Updating my system, going to take a little while... Partner in crime dzaima has tested (nightly, unstable, lto) and found it is somewhat better. Eyeballing, still ~20% slower…",{"id":107,"by":97,"text":108},"34648398","I was able to get glidesort running as part of the Robin Hood sort benchmark[1]. See [0]; it's a lot slower than fluxsort on random data. Wondering if I did something wrong. Is…",{"value":110,"source":85,"evidence":111},"Credit for prior work (fluxsort, quadsort) disputed",[112,115,118],{"id":113,"by":11,"text":114},"34654663","> It is my impression that orlp suggests the only relation between glidesort and fluxsort is that they're both stable quicksorts. So what is the relationship then, in your eyes?…",{"id":116,"by":11,"text":117},"34652516","> Keep in mind that glidesort is partly derived from fluxsort and many of its techniques were directly inspired by fluxsort\u002Fquadsort, while several others are implemented in a…",{"id":119,"by":11,"text":120},"34654126","I will retract that you didn't mention memory-level parallelism back then, I lazily looked at the git blame and assumed it was introduced then. That was sloppy of me, sorry. > I…",[122,133],{"value":123,"source":85,"evidence":124},"Benchmark source code and comparison against blitsort, pdqsort, fluxsort",[125,128,129],{"id":126,"by":97,"text":127},"34647069","Any source available for your benchmarks here? I'd like to benchmark against pdqsort, fluxsort, etc. but the existing benchmarks use C so I either have to call glidesort from C…",{"id":55,"by":56,"text":57},{"id":130,"by":131,"text":132},"34647439","nwmcsween","So how does this compare to PDQ, Crum, flux, etc? Do you have preliminary results?",{"value":134,"source":85,"evidence":135},"C or C++ port",[136],{"id":137,"by":138,"text":139},"34651610","loxias","Anyone have a C++\u002FC port yet? :) Would love to try this out, though the source looks... difficult for me to do a naive port.",[141,148],{"value":142,"source":85,"evidence":143},"How does the allocation and low-memory merging work",[144,145],{"id":88,"by":89,"text":90},{"id":146,"by":89,"text":147},"34647884","I used the word \"allocate\" imprecisely. (The plain English description in the README did a good job of explaining the up-front allocation needs.) What I meant to ask: How does…",{"value":149,"source":85,"evidence":150},"What is instruction-level parallelism and how does it help",[151],{"id":152,"by":153,"text":154},"34646810","cdiamand","Pretty neat! So it looks like you have a few things happening in parallel. What is instruction level paralellism and how does it speed the sort up?",[156,161,165,169],{"value":157,"source":85,"evidence":158},"fluxsort",[159,160],{"id":107,"by":97,"text":108},{"id":96,"by":97,"text":98},{"value":162,"source":85,"evidence":163},"pdqsort",[164],{"id":130,"by":131,"text":132},{"value":166,"source":85,"evidence":167},"blitsort",[168],{"id":55,"by":56,"text":57},{"value":170,"source":85,"evidence":171},"quadsort",[172],{"id":113,"by":11,"text":114},{"comments":174,"answered":175,"key":176},16,13,[177,178,181],{"id":76,"text":77},{"id":179,"text":180},"34648947","I get these results for your benchmark on my machine: https:\u002F\u002Fgist.github.com\u002Forlp\u002Fd7123ede0143e15ab0f8a435b7dd10b4 Either way, I am not surprised that glidesort is a bit slower…",{"id":182,"text":183},"34649324","My results are on an 2021 Apple M1 MacBook Pro. And I'd like to reiterate it's not 100% apples to apples comparing fluxsort and glidesort directly. One would need to either…",{"commenters":185,"max_depth":186,"maker_replies":174,"first_comment_mins":187,"lifespan_hours":188},27,10,48,45,[190,192,194,195,196,198,199,203,206,209,211,215,217,219,222,224,227,229,231,233,236,239,241,244,246,248,252,255,257,260,263,266,269,272,275,276,277,279,280,282,283,285,286,287,288,290,292,294,297,300,302,303,305,308,310,311,313,316,318,321,324,327,329,331,335,338,340,344,348,352],[107,33,38,191,97,33],"project\u002Fcritical\u002Fperformance",[76,33,33,193,11,38],"maker\u002Fneutral\u002Fperformance",[104,33,38,191,97,33],[179,33,33,193,11,38],[96,33,18,197,97,33],"project\u002Fneutral\u002Fperformance",[182,33,33,193,11,38],[200,33,33,201,202,33],"34654463","commenter\u002Fneutral\u002Fnone","nurettin",[204,33,33,201,205,33],"34654784","kzrdude",[207,33,33,208,202,33],"34658312","commenter\u002Fneutral\u002Fperformance",[210,33,33,201,205,33],"34659066",[212,33,18,213,214,33],"34653550","project\u002Fneutral\u002Fnone","orf",[216,33,18,213,205,33],"34654841",[218,33,18,213,214,33],"34655140",[220,33,18,213,221,33],"34655644","jules",[223,33,18,213,205,33],"34659038",[225,33,33,208,226,33],"34649722","scandum",[228,33,33,208,97,33],"34649859",[230,33,33,208,226,33],"34650061",[232,33,33,201,226,33],"34650141",[234,33,38,235,97,33],"34650267","project\u002Fcritical\u002Fexecution",[237,33,33,238,226,33],"34654185","commenter\u002Fneutral\u002Fidea",[113,33,33,240,11,38],"maker\u002Fneutral\u002Fidea",[242,33,44,243,226,33],"34655587","maker\u002Fpositive\u002Fidea",[245,33,33,238,97,33],"34655483",[247,33,33,238,226,33],"34657669",[249,38,33,250,251,33],"34649109","other\u002Fneutral\u002Fnone","nathell",[253,38,33,250,254,33],"34649208","rightbyte",[256,38,33,250,251,33],"34649274",[258,38,33,250,259,33],"34649552","mtlmtlmtlmtl",[261,38,33,250,262,33],"34650835","anacrolix",[264,38,33,250,265,33],"34651183","CyberDildonics",[267,38,33,250,268,33],"34651404","adgjlsfhk1",[270,38,33,250,271,33],"34653047","andromeduck",[273,38,33,201,274,33],"34652164","saagarjha",[55,41,18,197,56,33],[59,41,33,193,11,38],[278,41,38,191,226,33],"34650406",[116,41,33,238,11,38],[281,41,33,238,226,33],"34653662",[119,41,33,238,11,38],[284,41,44,243,226,33],"34655727",[88,18,18,197,89,33],[52,18,33,197,11,38],[146,18,18,197,89,33],[289,18,33,197,11,38],"34647980",[291,18,18,197,89,33],"34648192",[293,18,33,197,11,38],"34648329",[295,18,44,296,89,33],"34648840","maker\u002Fpositive\u002Fdocs",[298,18,18,197,299,33],"34648255","zamalek",[301,18,33,193,11,38],"34648306",[152,34,18,197,153,33],[304,34,33,197,11,38],"34646998",[306,34,18,197,307,33],"34647540","repsilat",[309,34,33,201,11,38],"34647546",[130,44,18,197,131,33],[312,44,33,197,11,38],"34647504",[314,44,18,197,315,33],"34647931","moonchild",[317,44,33,197,11,38],"34648061",[319,44,44,320,226,33],"34650752","project\u002Fpositive\u002Fperformance",[322,44,18,323,205,33],"34647532","maker\u002Fneutral\u002Fnone",[137,325,44,326,138,33],6,"project\u002Fpositive\u002Fnone",[126,31,18,328,97,33],"project\u002Fneutral\u002Fdocs",[70,31,33,330,11,38],"maker\u002Fneutral\u002Fdocs",[332,333,33,250,334,33],"34649204",8,"olliej",[336,333,33,250,337,33],"34650250","vba616",[339,333,33,250,334,33],"34651854",[341,342,33,343,205,33],"34663359",9,"other\u002Fneutral\u002Fidea",[345,186,44,346,347,33],"34648917","maker\u002Fpositive\u002Fnone","nerdfaktor42",[349,350,44,346,351,33],"34646898",11,"ww520",[353,350,33,250,205,33],"34666038",[],[356,361,366,371,376,380],{"id":357,"name":358,"points":359,"category":360},"34635352","Maroofy",753,"ai",{"id":362,"name":363,"points":364,"category":365},"34713202","Filmbox",658,"creative",{"id":367,"name":368,"points":369,"category":370},"34706098","Kuboble.com",437,"games",{"id":372,"name":373,"points":374,"category":375},"34639728","DriftDB",367,"dev_tools",{"id":377,"name":378,"points":379,"category":375},"34648266","DocsGPT",256,{"id":381,"name":382,"points":383,"category":370},"34685086","FlappyBirdle",232,false,"v2",{"id":387,"name":5,"line":6,"ai":384,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":388,"top":18,"kw":389,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":390,"url":9,"mix":391,"praise":84,"objection":101,"sub":21},34646199,0.2,[24,25,26,27],"1130003330010500000301050335033335530055",[31,32,33,34],1794036630801]