3 ms·
Well more like O(m * n) calls where m << n, but that is a fair point.
by mnarayan01 12y ago
Well more like O(m * n) calls where m << n, but that is a fair point.
- nirvdrum 12y agoIn this case, the constant really can't be ignored since file system access is so slow. Ruby scans for .rb and .so files (or .jar on JRuby). Some other fun is RubyGems always appends to the $LOAD_PATH, so whenenver you require from a gem that hasn't been loaded yet, you're guaranteed to scan the entire $LOAD_PATH on the off-chance there's a conflicting partial path. And you can't cache contents of the $LOAD_PATH entries unless you have a filesystem watcher because the contents of the path can change and Ruby allows that.