Is get_option() faster than accessing get_transient()?


Today I run a test over my db to explore the speed difference between accessing a key from options, custom table & transients. I ran the test for 1000 times and following is the time taken to run 1000 get operations:

  1. get_transient() 0.0245 seconds
  2. get_option() 0.0068 seconds
  3. simple select operation from Custom Table 0.65 seconds

I also checked that transient was not expired during this test. So the question is, is get_option() faster than get_transient() or did I mess up something in my test? Is custom table delay due to options being cached default by WordPress? Also, is options also cached by different caching plugins like the transients?

, , , learning_13 3 years 2020-04-05T08:51:01-05:00 0 Answers 102 views 0

Leave an answer