3 ms·
To be fair to non-Javas, the java version is using Java code because Java sucks at calling out to faster languages.
by adgjlsfhk1 5y ago
To be fair to non-Javas, the java version is using Java code because Java sucks at calling out to faster languages.
- azth 5y agoThere's JNI that exists now. And Project Panama will be a big improvement.
- zmmmmm 5y agoOh yes, that Python code looks so idiomatic: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-python3-2.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- viraptor 5y agoregex=PCRE2.pcre2_compile_8(pattern, c_size_t(len(pattern)), c_uint32(0), byref(c_int()), byref(c_size_t()), None) As far as FFI goes, I would say this looks amazingly simple.
- pmontra 5y agoCan't comment on that but why are these people putting spaces after commas (correct) and not to the left and right of the assignment sign = ? It's so weird to read a=b
- oefrha 5y agoThat’s very straightforward translation of C code using pcre to Python using ctypes. It doesn’t look great because the ugliness isn’t wrapped in a library. But Python ctypes definitely isn’t hard to use. It is unsafe as hell though.
- igouy 5y agoAlternatively see Python #1 https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-python3-1.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
- igouy 5y agoSeems to be OK in pidigits — Java #3 program https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/pidigits-java-3.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/... C gcc #6 0.56s Java #3 0.79s