enhance strlen to improve performance