In a large pot or Dutch oven, heat the butter and olive oil over medium heat.
Add the sliced onions, sugar, salt, and black pepper. Sauté the onions for about 15-20 minutes, stirring frequently, until they are caramelized and golden brown.
If using, pour in the white wine and cook for an additional 2-3 minutes, allowing it to reduce slightly.
Add the rice to the pot, stirring to coat it well with the onion mixture.
Pour in the beef broth and bring the mixture to a boil.
Once boiling, reduce the heat to low, cover, and let it simmer for about 15 minutes, or until the rice is cooked and has absorbed most of the liquid.
Stir in half of the Gruyère cheese, mixing until melted.
Ladle the soup rice into bowls and top with the remaining cheese. Place under a broiler for a few minutes if you want a bubbly, golden top.
Garnish with fresh thyme or parsley before serving.