4 ms·
The computer language benchmarks game[1][2][3] may be of interest here. It benchmarks C, Python, Javascript, and Julia, in several tasks involving FASTA input (
by mindB 6y ago
The computer language benchmarks game[1][2][3] may be of interest here. It benchmarks C, Python, Javascript, and Julia, in several tasks involving FASTA input (regex-redux, k-nucleotide, and reverse-complement), but implementations are bespoke rather than relying on libraries. Relative timing is much more favorable for Julia in these benchmarks. Looks worse for Python outside regex-redux.
[1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/knucleotide.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
[2] https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/revcomp.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
[3] https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/regexredux.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- anonymoushn 6y agoI recently spent some time in the Lua section of the benchmarks game. It is a sad place for a few reasons: - Lua programs cannot use shared memory concurrency or subprocesses with 2-way communication with the master process. - Lua programs run on a very slow runtime compared to the fastest Lua runtime. My impression after this is that for languages that aren't super fast and don't include all the primitives one could want, benchmarks like reverse-compliment are mainly measuring whether the language's standard library includes some C function that does the bulk of the work.
- mindB 6y agoI would love it if Isaac included LuaJit and pypy in the benchmarks game, but ultimately I get it; it's just one guy's project, and he doesn't want to spend the time to maintain it across the entire incredible diversity of programming languages/implementations[1]. To a great extent any "language" benchmark (for languages that don't compile to efficient machine code) is certainly a benchmark of the language's standard library. I'm not sure there's a way around that reality. Are there external Lua libraries that allow shared-memory concurrency? If so, it's probably worth opening an issue asking whether those libraries could be allowed[2]; it might just be that nobody has submitted a program making use of Lua shared concurrency. [1] https://benchmarksgame-team.pages.debian.net/benchmarksgame/sometimes-people-just-make-up-stuff.html#maintenance-burden https://benchmarksgame-team.pages.debian.net/benchmarksgame/... [2] https://salsa.debian.org/benchmarksgame-team/benchmarksgame/-/issues https://salsa.debian.org/benchmarksgame-team/benchmarksgame/...
- igouy 6y ago> … shared memory concurrency or subprocesses with 2-way communication with the master proc Isn't that the same situation as Python, Perl, PHP, Ruby… except for those languages, programmers have converted the programs to use multicore ?
- anonymoushn 6y agoNo, for example Python subprocess lets you talk to the subprocess on stdin and stdout. Lua popen only gives you one of those two things. This means that the proposed work sharing model at https://benchmarksgame-team.pages.debian.net/benchmarksgame/description/fannkuchredux.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... cannot be used, because it requires workers to submit results to be aggregated and accept new chunks of work.
- igouy 6y agoDoes it mean that none of the other Lua programs could be written to use multicore? spectral-norm?
- anonymoushn 6y agoNo, it does not mean that. I'll submit my multicore pfannkuchen-redux and reverse-compliment when I get around to it, and look at other problems after that. The pfannkuchen-redux is just a bit hampered by uneven work sharing. For reverse-compliment, it's a bit more trouble to work around the lack of 2-way communication. My implementation writes the entire input to stdout, then workers use fseek on stdout, which only works if you are piping the output of the command to a file. That is, it generates correct output if you run "lua blah.lua > out" but not if you run "lua blah.lua | cat > out" Additionally, since there's no pwrite and no way of getting a new open file description for stdout, I must cobble together a mutual exclusion mechanism to prevent workers from seeking while another worker tries to write.
- igouy 6y agoJust curious, hasn't multicore been enough of an opportunity for this to be addressed by the Lua community?
- burntsushi 6y ago> Looks worse for Python outside regex-redux Take a look at the source code for the top Python program for regex-redux.
- mindB 6y agoI'm aware. To a large extent both regex-redux and pidigits are measures of the overhead of FFI for all non-C/C++/Rust languages. Rust is very cool in that one for actually using a regex engine implemented in Rust; definitely has my admiration.
- burntsushi 6y agoAs the author of Rust's regex engine, thanks. :-) But yeah, just wanted to make sure people are actually looking at the code. The top submission for Python, for example, is not how I've ever seen anyone use regexes in Python. That's an important dimension to evaluate in these discussions! (But not the only one, of course.) > Rust is very cool in that one for actually using a regex engine implemented in Rust One wonders how long it will be until someone submits a Rust program that uses PCRE2.
- igouy 6y ago> … actually looking at the code. Yeah, like "Always look at the source code." > … not how I've ever seen anyone use regexes in Python. More like this…? https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-python3-1.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- burntsushi 6y ago> More like this…? Yes. Not sure what your point is though. The GP wasn't talking about that submission. ;-)
- igouy 6y ago…seek, and ye shall find… :-)