Westerners know more about where the Soviet elite shops for food than how it selects its leaders. Of all the dark mysteries shrouded within the walls of the Kremlin, the process by which Communist Party leaders are named is perhaps the most secretive.

The sixth transfer of power after death or dismissal of the previous leader under the Soviet system installed in 1917 occurred in Moscow yesterday. And again, the only part of the process that the West was able to observe was the announcing of the new leader's name some time after the old one had died.

Not even the length of time the decison takes is constant -- Nikita Khrushchev did not take the reins of power until three years after his predecessor, Joseph Stalin, died.

In contrast, Mikhail Gorbachev was elected leader of the Soviet Communist Party a little over four hours after the state media released the news of the death of Konstantin Chernenko. The selection was made in record time in recent Kremlin history. Chernenko himself became party head four days after the death of Yuri Andropov. Andropov's appointment, in November 1982, took two full days after his predecessor, Leonid Brezhnev, died.

Diplomats in Washington and western Sovietologists feel that the swiftness of Gorbachev's ascension to power firmly indicates that the ruling Politburo, responsible for choosing the Communist Party leader, is becoming more sophisticated and decisive in bringing about an orderly succession.

"The Soviet leaders recognized that the rest of the world was not going to stop because their leader had died," said one State Department official. "They realized that a big gap had been created, and they moved quickly to fill it."

Despite the relative smoothness of this third transition of power in Moscow in 28 months, the process is still a mysterious one about which even the experts know little. Although it seems that the head of the funeral committee is destined to assume the leadership position, nothing is known outside the Kremlin of how the funeral committee head is chosen or even who chooses it.

Equally little is known about the actual mechanics of naming a Soviet leader. Whether Poliburo members debate for long periods, vote, reach a consensus, or plot to outmaneuver one another is open to speculation.

But the surprising speed with which Gorbachev was chosen yesterday stands out as an important and clear signal. Jerry Hough, a Sovietologist at the Brookings Institution, said in a telephone interview: "The speed with which this took place is a signal that the Soviets are demonstrating that they are in charge and not wrapped up in sluggishness, as Reagan and others have indicated. In the next few months we are likely to see other signals demonstrating their decisiveness at the top."

Indeed, the manner of Gorbachev's selection indicates that a certain orderliness is developing in the methodology used by the 10-member Politburo in choosing a new leader.

Like most of his predecessors, Gorbachev was named head of the funeral committee soon after Chernenko's death was announced. Informed observers immediately concluded that he would eventually assume power.

The fact that one Politburo member, Vladimir Shcherbitsky, was traveling in the United States as it became apparent that a transition in power was under way, and that another, Andrei Gromyko, had made recent trips to Spain and Italy, refutes the common image of a Soviet leadership locked in a tortuous indeciveness during one of its leader's illnesses and after his death.

"The most striking aspect of Gorbachev's rise so far," said one U.S. diplomat, "is that it seems to have been in the works for some time. For a long time now the fact that he was the No. 1 candidate in the leadership stakes has been clear."

To the outside world Gorbachev has behaved much like a No. 2 man on the rise ever since Chernenko took over 15 months ago, despite the fact that the Soviet system has no formal hierarchy with assigned understudy roles.

Sometime during the spring of 1983 he apparently assumed responsibility for personnel selection within the party. State Department officials have noted that when the Politburo has met in recent months it was Gorbachev who seemed to chair sessions in Chernenko's absence.

He traveled to Canada in May 1983 and to Britain last December -- and made a strong impression on officials he met.

Hough said the smooth choice of Gorbachev indicates how he has consolidated power in recent years. Further consolidation seems inevitable. Of the 300 members of the powerful party Central Committee, nearly 40 percent will be either retired, promoted, or at least 70 years old when the body meets for elections early next year.