Which is unoptimized code! Those algorithms will perform differently well on different architectures. An architecture that runs them well is considered to be good at 'general purpose code'. The actual tasks that 'general purpose code' perform are not 'general purpose tasks' : 'general purpose tasks' don't exist. Thus a chip that performs poorly on 'general purpose code' may not be bad at the task that code is doing; it could just be needing a different, non-generalised implementation. That doesn't mean to say that any processor can perform well at any task, though. Some processors just aren't well designed for some tasks no matter what the implementation.
You're confusing high level language with low level language. Just because you're using high level language doesn't mean your code is unoptimised. You can have optimised AND unoptimised high level code.