In prewar Europe (particularly Germany, Hungary, Poland, and the Soviet Union), how did rates of linguistic assimilation differ among Ashkenazi Jews?
Assimilation is obviously very hard to define, so I'm mostly wondering about primary language. It is very difficult to assimilate into a nation's culture without being completely fluent in the language, and I'm sure that many Jewish people who wished to assimilate would have been unable to if they only spoke Yiddish.
I believe that Yiddish was overwhelmingly the primary language of Jews in Poland and the Soviet Union, but what about Germany? Standard German and Yiddish are so similar that I'd expect that many or most Jews had no difficulty speaking the national language. Would assimilated Germans of Jewish descent (such as Felix Mendelsohn or Karl Marx) have spoken any Yiddish at all? Did rural Yiddish communities (Shtetls) even exist in Germany?
Hungary had a very large Jewish population before WW2 (with Budapest being about a quarter Jewish), so I wonder how these people fit into Hungarian society.
I assume that the situation in Russia would be different altogether. Some high-ranking Soviet officials had been Jewish (Trotsky, Sverdlov) and were presumably completely assimilated into Russian culture, but outside the educated urban Jewish population, did any Jewish people speak Russian as a primary language? In my area, there is a small but noticeable community of Russian Jewish immigrants, but all of them speak Russian as their primary language. When did the Soviet-era shift of Yiddish to Russian occur? I believe that, initially, the Soviet government supported Yiddish as a bourgeois language.
My impression of the Polish Jewish community, mostly through stories from friends whose grandparents or great-grandparents left Poland, suggests that Jews in Poland were very separate from Polish society, mostly speaking Yiddish (even in cities) and usually living in entirely Jewish villages. One friend, who is of non-Jewish Polish descent, says that his grandfather was actually conversational in Yiddish, because the town he lived in was once almost half-Jewish, and most of the Jewish residents spoke no Polish. Was this representative of the Polish Jewish community at large?
You're correct that the situation in Western Europe was very different than in Eastern Europe. In the 19th century, Jews were successively emancipated across Europe. The result was a much higher degree of assimilation, including changing languages. At the beginning of the 19th century, Western Yiddish was the common language of Jews in Germany (and parts of the Netherlands and France), by the end of the century it was quite rare. An assimilated German from the era would probably not be able to speak Yiddish, but depending on their family they might be able to understand a little, aided mostly by its similarity to German. Note that this would be Western Yiddish, which was somewhat different from Eastern Yiddish (all surviving dialects today, including academic standard Yiddish, are Eastern). Note that standard German is fairly similar to standard Yiddish. For actual natively spoken Yiddish there's no guarantee of mutual comprehensibility, though this varies heavily by dialects of those involved and the speakers' ear for it. Western Yiddish would've been closer, since it doesn't have slavic loanwords, but it's still worth noting.
In Eastern Europe in general, the overwhelming majority of Jews were not assimilated. There did exist a class of Jewish intelligentsia in cities who would've spoken the local language, but these were not the norm. It's also important to note that many of the non-assimilated Jews still would've had some level of proficiency in the local language. Maybe not enough to write a book in it, but some ability in it (depending on the needs of the individual to interact with the non-Jewish community). It was even in the US not uncommon for people who lived in Jewish areas to know a little Yiddish, for social interaction with Jews, since that was simply the language Jews would speak and it was useful to know (Jews who didn't speak Yiddish would sometimes learn it as an additional language for this purpose). Parts of Eastern Europe had very substantial Jewish minorities, which is what made Yiddish-speaking communities possible.
As for shifting from Russian to Yiddish was mostly post-war. A few things happened at that time. First, the Holocaust killed a large share of Yiddish-speakers, and uprooted Jewish communities in general. Second, as Stalin's policies got much more strongly anti-Jewish, Yiddish became a less socially accepted language to speak. These two factors basically destroyed Yiddish's social prestige.
Staying of Jews in Poland was mainly based on a legal document called The Kalisz Status (1264) which granted them king's protection and the priviledge of holding their own judicary system amongst themselves and fair treatment in non jewish court. In return they volountary excluded themselves from taking on positions of power. This quasi apperheit is the primary reason of our successful cohabitation of half a millennium.
While peasants and the poor especially outside the core polish counties of Greater and Lower Poland, Masovia, Pomeralia, Silesia, Galicia and Ruthernia could get by with little or none knowlegde of polish it would've been impossible for craftsmen and city dwellers to thrive that way.