Naive performance comparison of a few programming languages (JavaScript, Kotlin, Rust, Swift, Nim, Python, Go, Haskell, D, C++, Java, C#, Object Pascal, Ada, Lua, Ruby)
Hello I tried to implement this in Eiffel. Unlike many of the languages used here, Eiffel doesn't allow one to modify arguments to a procedure, so I had to work around this by boxing the arguments. This requires me to perform a lot of copying, which slows the code significantly. (I noticed that the Python code seems to do the same thing.) One way to get around this (recommended by some Eiffel gurus) is to use _non_-recursive techniques. The easiest to see would be `has_value()`, because checking whether the tree has a value can be done with a simple loop that descends into the tree. On the other hand, it can give an unfair advantage to this one procedure because it's no longer detaching & re-attaching nodes the way as this version does via `split()` and `merge()`. So: for languages that don't allow one to modify arguments to a procedure, is it acceptable to use a different technique if that improves timing, so long as the resulting work is "the same"? For what it's worth, changing `has_value()` to a loop cut running time by 33%.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by johnperry-math and has received 3 comments.