Nutritionally, they are much the same. They are both high in carboydrates and pretty low in protein. Comparing them like for like isn't quite fair as typically pasta has more protein than gnocchi, but gnocchi less carbs by weight. But don't worry about any of this and just enjoy both as part of a balanced diet