There's no shortcut: read the docs from the front to cover.
Not necessarily every single last page of it. But do make sure that you know and understand what is available and what is possible; well enough that googling typically occurs when you have a reasonable idea of what you're going to find already but don't have the specifics off the top of your head.
3rd-party libraries are a slightly different story, of course: you can't reasonably be familiar with every single one of them. What you can and should know, though, is what your languages, frameworks and tools are capable of and adequate for. This allows to be able to quickly locate any third-party library you might need, and quickly evaluate their suitability and quality.
Another important aspect is the lack of distraction: when given the opportunity to do so, faster coders tend to keep stuff like email and chat off, and get to work hours at a time without interruption.