Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Benchmarking the performance difference between properties and fields on custom entities

Test 1: entity_load 5000 custom entities, using entity cache, without memcache

Run with 18 fields 1 property

First run

  • 33948.94ms

Remaining runs

  • 2376.19ms
  • 2443.55ms
  • 2209.95ms
  • 2189.75ms
  • 2186.69ms

Run with 19 properties

First run

  • 808.01ms

Remaining runs

  • 780.8ms
  • 760.14ms
  • 788.79ms
  • 771.91ms
  • 775.6ms

Run with 9 properties and 10 fields

First run

  • 22197.15ms

Remaining runs

  • 2007.83ms
  • 1997.54ms
  • 1935.69ms
  • 1994.95ms
  • 1976.5ms

Run with 9 properties and 3 fields

First run

  • 13013.32ms

Remaining runs

  • 1961.2ms
  • 1747.51ms
  • 1850.39ms
  • 1814.27ms
  • 1744.52ms

Test 2: entity_load 5000 custom entities, using entity cache with the memecache backend:

Run with 0 fields 11 property

First Run

  • 771.89ms

Remaining runs

  • 752.53ms
  • 752.21ms
  • 783.14ms
  • 830.99ms
  • 762.35ms

Run with 10 field 1 property

First Run

  • 20112.11ms

Remaining runs

  • 1354.1ms
  • 1391.62ms
  • 1357.02ms
  • 1361.55ms
  • 1356.04ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment