Slide 36
Slide 36 text
Using memory profiler to opEmise pluck
#
CREATE
TABLE
products(id
int,
in_stock
boolean,
price
int,
tax
int)
#
ActiveRecord
version
4.2.1
ActiveRecord::Base.establish_connection({
adapter:
'postgresql',
database:
'test'
})
MemoryProfiler.report
do
Product.limit(10).pluck(:price,
:tax)
end.pretty_print
286
objects
allocated
25K
byte
allocated