In one of my C application I am using, below functions from ctype.h :
isalpha(), isspace(), ispunct(), tolower().
After profiling I see there are some bottlenecks in the calls of these functions(Basically my app is a character/string processing from a input text file and hence these functions are called exhaustively inside critical loops)I want to optimize them for speed and have my own implementation if it helps.
Where can I find such or logic to implement them?
It sounds to me odd that such functions can be your bottleneck; likely they can take into account the locale, and this makes them “slower”. If you can disregard it, then you can implement them as easily as (e.g.: this is just an idea wrote on the fly)
Then make them inline functions.