Created
April 27, 2016 23:55
-
-
Save SamSaffron/f73fd0395e050e927d1a3137373eeaee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'memory_profiler' | |
LONG_STRING = " this is a longer test | |
this is a longer test | |
this is a longer test | |
this is a longer test | |
this is a longer test" | |
MemoryProfiler.report do | |
LONG_STRING.empty? || !(/[[:^space:]]/ === LONG_STRING) | |
end.pretty_print | |
gets | |
MemoryProfiler.report do | |
LONG_STRING.empty? || (/\A[[:space:]]*\z/ === LONG_STRING) | |
end.pretty_print | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment