Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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