Place the basil leaves, walnut pieces, garlic cloves, and olive oil into a food processor or strong blender. Pulse until chopped, about 20 seconds. Use a small spatula to scrape down the sides and pulse again, another 3-5 seconds. Add the parmesan, pulse 3-5 more seconds until the pesto is your desired consistency. Add salt and pepper and pulse again to taste (if needed). Serve.