Write a function to find the frequency of all characters in a given string and optimize it for large inputs.
Implement character_frequency(s) and return a dictionary mapping each character to its number of occurrences. Counting is case-sensitive, spaces and punctuation are valid characters, and an empty string returns an empty dictionary. For example, "Bosch AI" returns { "B": 1, "o": 1, "s": 1, "c": 1, "h": 1, " ": 1, "A": 1, "I": 1 }.
def character_frequency(s):