dataset vs getAttribute vs jQuery .data() vs jQuery .attr()Fastest: getAttribute (43.9x faster)
2,122,080 ops/sec
2,028,867 ops/sec
53,844 ops/sec
48,317 ops/sec
Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.
| Test case name | Result |
|---|---|
| dataset | |
| getAttribute | |
| jQuery .data() | |
| jQuery .attr() |
| Test name | Executions per second |
|---|---|
| ✓ getAttribute | 2,122,080 Ops/sec |
| dataset | 2,028,867 Ops/sec |
| jQuery .attr() | 24,723 Ops/sec |
| jQuery .data() | 23,111 Ops/sec |