`.typename` is incredible slow because it deals with strings. It's many times faster to check the class. Use `.is_a?(Sketchup::Face)`. Or even `grep` - which is normally the fastest way to get one type of entities from a collection: `inner_face.grep(Sketchup::Face)`.

http://www.thomthom.net/thoughts/2011/12/never-ever-use-typename/