[{"data":1,"prerenderedAt":217},["ShallowReactive",2],{"project-14683769":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":34,"aspects":35,"strip":37,"post_text":29,"what":38,"said":62,"maker_in_thread":139,"shape":148,"grid":152,"attempts":180,"same_week":181,"maker_shows":34,"maker_hidden":210,"reader_version":211,"card":212},"14683769","notebooks","Fast suffix arrays in Python","title","Show HN: Fast suffix arrays in Python","https:\u002F\u002Flouisabraham.github.io\u002Fnotebooks\u002Fsuffix_arrays.html","louisabraham.github.io","Labo333",1499021221,2017,72,14,617,2242,28,"notable","languages","suffix array construction","library",[24,25,26,27],"suffix array","python","prefix doubling","lcp","quiet",null,{"positive":31,"neutral":32,"mixed":31,"critical":33},0,1,3,4,{"performance":36},{"positive":31,"critical":33},[31,31,31,31,32,31,32,32,31,33,31,31,31,31],{"problem":39,"audience":29,"pricing":29,"motivation":46,"time_to_build":29,"stack":50,"openness":61,"stage":61,"team_size":61},{"value":40,"source":41,"evidence":42},"Computing suffix arrays in Python with a short, readable implementation","maker",[43],{"id":44,"by":11,"text":45},"14686399","OP and author here :) Python is not the fastest programming language in the world either. As I said, I wanted something simple (less than 20 lines and quite readable) that…",{"value":47,"source":41,"evidence":48},"Wanted a simple, readable implementation that performs well on random data",[49],{"id":44,"by":11,"text":45},[51,55],{"value":52,"source":41,"evidence":53},"Python",[54],{"id":44,"by":11,"text":45},{"value":56,"source":41,"evidence":57},"Jupyter notebook",[58],{"id":59,"by":11,"text":60},"14691044","Cool page! It would be really great to have the code shipped in a single file so that people can use it! I love Jupyter notebooks because 1) they are beautiful 2) if you download…","unknown",{"praise":63,"objections":72,"requests":95,"questions":108,"alternatives":116},[64],{"value":65,"source":66,"evidence":67},"Readable and interesting reference implementation","commenter",[68],{"id":69,"by":70,"text":71},"14684781","lqdc13","\"Suffix arrays : How to compute them fast with Python\" The assumption is it's fast in Python without using Cython etc. My intuition says that looping and iterating in Python is…",[73,83,91],{"value":74,"source":66,"evidence":75},"No comparison benchmarks against other implementations",[76,79],{"id":77,"by":70,"text":78},"14684032","Is there another implementation we can compare this with? Kind of crazy to say that this is fast without any comparisons with anything else. So far I've been using suffix trees…",{"id":80,"by":81,"text":82},"14684627","dom0","Article seems to be mostly about efficient, not fast.",{"value":84,"source":66,"evidence":85},"Pure Python is slow compared with C or divsufsort-style algorithms",[86,90],{"id":87,"by":88,"text":89},"14685043","matt4711","There are much faster SA construction algorithms than skew (check out divsufsort). The O(n) algorithms using induced sorting are also likely much faster than this work. The…",{"id":69,"by":70,"text":71},{"value":92,"source":41,"evidence":93},"Uses a lot of memory due to set and dict",[94],{"id":44,"by":11,"text":45},[96,104],{"value":97,"source":66,"evidence":98},"Compare against other implementations",[99,100],{"id":77,"by":70,"text":78},{"id":101,"by":102,"text":103},"14686902","pathsjs","You can test it against https:\u002F\u002Funicredit.github.io\u002Fcello\u002F",{"value":105,"source":66,"evidence":106},"Ship the code in a single file",[107],{"id":59,"by":11,"text":60},[109],{"value":110,"source":66,"evidence":111},"Pointers to parallel suffix array construction algorithms",[112],{"id":113,"by":114,"text":115},"14686812","pelario","Hi, do you have some pointers for \"linear speedup parallel SA construction algorithms.\" ? Thanks!",[117,121,125,132],{"value":118,"source":66,"evidence":119},"divsufsort (libdivsufsort)",[120],{"id":87,"by":88,"text":89},{"value":122,"source":66,"evidence":123},"Cello suffix array implementation",[124],{"id":101,"by":102,"text":103},{"value":126,"source":66,"evidence":127},"Doug's MM suffix array C implementation",[128],{"id":129,"by":130,"text":131},"14685065","xfer","When i was doing a derivation of LZ compression using suffix arrays i used induced sorting. Here is a good overview: http:\u002F\u002Fzork.net\u002F~st\u002Fjottings\u002Fsais.html. Also i think Doug's C…",{"value":133,"source":66,"evidence":134},"sary",[135],{"id":136,"by":137,"text":138},"14685420","visarga","Anyone remember \"sary\"? It was doing suffix arrays 17 years ago. Last update was in 2005. http:\u002F\u002Fsary.sourceforge.net\u002F",{"comments":34,"answered":32,"key":140},[141,142,145],{"id":44,"text":45},{"id":143,"text":144},"14687792","Hi, sorry, I don't have anything in particular. However, it seems that http:\u002F\u002Fsnnynhr.github.io\u002FParallelSuffixArrays\u002F contains interesting algorithms and links.",{"id":146,"text":147},"14686449","I'm not sure about the difference, but yes :) I wanted an implementation that could fit on my screen and still be efficient. Of course Python is slow and even my algorithm is not…",{"commenters":149,"max_depth":33,"maker_replies":34,"first_comment_mins":150,"lifespan_hours":151},9,65,33,[153,155,157,159,161,163,167,168,169,171,173,175,177,179],[87,31,31,154,88,31],"commenter\u002Fneutral\u002Fexecution",[44,31,31,156,11,32],"maker\u002Fneutral\u002Fexecution",[113,31,31,158,114,31],"commenter\u002Fneutral\u002Fnone",[143,31,31,160,11,32],"maker\u002Fneutral\u002Fnone",[77,32,32,162,70,31],"project\u002Fcritical\u002Fperformance",[164,32,31,165,166,31],"14684227","other\u002Fneutral\u002Fnone","fnl",[80,32,32,162,81,31],[69,32,32,162,70,31],[146,32,31,170,11,32],"maker\u002Fneutral\u002Fperformance",[101,32,33,172,102,31],"project\u002Fneutral\u002Fperformance",[129,174,31,165,130,31],2,[59,174,31,176,11,32],"maker\u002Fpositive\u002Fdocs",[178,174,31,158,130,31],"14693287",[136,33,31,165,137,31],[],[182,186,191,196,200,205],{"id":183,"name":184,"points":185,"category":20},"14703098","A virtual machine made with Google Sheets formulas (no script)",620,{"id":187,"name":188,"points":189,"category":190},"14691407","Under the hood ReactJS",266,"learning_science",{"id":192,"name":193,"points":194,"category":195},"14662860","VisiData",221,"dev_tools",{"id":197,"name":198,"points":199,"category":195},"14688031","Vecta.io",154,{"id":201,"name":202,"points":203,"category":204},"14690517","Artpip",142,"creative",{"id":206,"name":207,"points":208,"category":209},"14694210","login-with",127,"infrastructure",false,"v2",{"id":213,"name":5,"line":6,"ai":210,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":214,"maker":11,"domain":10,"tier":19,"attempts":31,"strip":215,"url":9,"mix":216,"praise":65,"objection":74,"sub":21},14683769,[24,25,26,27],"00001011030000",[31,32,31,33],1793990960971]