From 1352a5b5fa716c99c47ac784aa2d64186e17af0e Mon Sep 17 00:00:00 2001 From: Daniel Waterworth Date: Mon, 21 Oct 2019 12:21:10 +0100 Subject: [PATCH] DEV: undo pluck_first changes to micro benchmark and add pluck_first benchmark --- script/micro_bench.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/script/micro_bench.rb b/script/micro_bench.rb index 741d936428eba..51ea6c89128a1 100644 --- a/script/micro_bench.rb +++ b/script/micro_bench.rb @@ -15,10 +15,14 @@ end b.report("pluck with first") do - User.pluck_first(:name) + User.pluck(:name).first end b.report("pluck with limit") do + User.limit(1).pluck(:name).first + end + + b.report("pluck with pluck_first") do User.pluck_first(:name) end