Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Chrome 65
Windows
Other
2025 years ago
Test name Executions per second
.first() 61157.2 Ops/sec
:first 41783.9 Ops/sec
.filter(:first) 35651.9 Ops/sec
.eq(0) 57153.0 Ops/sec
$(.get(0)) 49856.6 Ops/sec
$([0]) 55035.2 Ops/sec
:eq(0) 43791.0 Ops/sec
HTML Preparation code:
Tests:
  • .first()

  • :first

  • .filter(:first)

  • .eq(0)

  • $(.get(0))

  • $([0])

  • :eq(0)


;