At most jobs I've been at so far, "optimizing code" involved digging through the entire codebase with profilers and instrumentation for weeks at a time trying to find performance bottlenecks. Then maybe if you were very lucky you got to fix it, but more often than not it was an architectural bottleneck and you'd be SOL, best case is that a domain expert would get to fix it.
Then again this is dealing with system-wide performance. Application-specific performance should be significantly less of a problem to fix.
I think the jobs that are simply "here is this function, make it 10x faster" would be pretty rare, since usually people don't know what part of the code is going slow. A lot of the times they'll guess "X, Y, Z is making it slow" but without a real performance analysis patching stuff all over the place just doesn't pan out.
Then again this is dealing with system-wide performance. Application-specific performance should be significantly less of a problem to fix.
I think the jobs that are simply "here is this function, make it 10x faster" would be pretty rare, since usually people don't know what part of the code is going slow. A lot of the times they'll guess "X, Y, Z is making it slow" but without a real performance analysis patching stuff all over the place just doesn't pan out.