Open adsharma opened 3 years ago
Using the @sealed decorator derived from the adt
library makes it around 4-5x slower than the Java derived version. Likely because of all the isinstance()
checks inside the libary. Need to benchmark it again when python supports something similar natively.
My goal is to transpile this version of the library to rust and see how well the transpiled + optimized code performs.
What is wrong with the richard's benchmark being OO? OO programming is widely used. Do you think that OO programming is over represented in the benchmark suite as a whole?
Certainly OO programming is widely used and should be proportionately represented. I feel the following are underrepresented:
The richard's benchmark included with pyperformance seems to be a C -> C++ -> Java -> Python port. It makes heavy use of object oriented programming and doesn't look anything like the original C code.
I've been playing with the python2 version distributed from their website. I ported it to python3. It looks more like the C version, which has some good things and a few bad things:
+ Covers non-OO programming use case - Overloads variables as in
Union[int, Type1, Type2]
I'm in the process of improving it to
Optional[Type1]
andOptional[Type2]
My goal is to explore a dialect of statically typed python using modern pythonic constructs:
The code is here: https://github.com/adsharma/richards-benchmark. Let me know if this sounds interesting and if you'd like to update the variant in the repo at some point in the future. I hear some of the faster cpython work is using these benchmarks.