Title: Performance
Last modified: May 17, 2022

---

# Performance

 *  Resolved [Cyrille Sanson](https://wordpress.org/support/users/css31/)
 * (@css31)
 * [4 years ago](https://wordpress.org/support/topic/performance-58/)
 * Hi,
 * A developer told me that putting the code in Code Snippets instead of functions.
   php or a plugin loses performance.
 * The argument would be that the code used via Code Snippets is in the database,
   whereas with a plugin the code is in a file.
 * Using a file would be faster.
 * What do you think about this?
 * Best,

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Shea Bunge](https://wordpress.org/support/users/bungeshea/)
 * (@bungeshea)
 * [4 years ago](https://wordpress.org/support/topic/performance-58/#post-15651905)
 * With version 3.0.1, your snippets are fetched from the database ones and then
   cached with object caching, if available.
 * If your hosting supports persistent caching, then the only additional overhead
   it just what it takes to fetch the code from the cache and iterate through it.
   The performance of that will depend on which object caching solution, but I imagine
   it would be fairly insignificant in the overall WordPress loading process.
 * We are looking at introducing loading snippets from files in the future, but 
   that’s still a few versions away.
 *  Thread Starter [Cyrille Sanson](https://wordpress.org/support/users/css31/)
 * (@css31)
 * [4 years ago](https://wordpress.org/support/topic/performance-58/#post-15651942)
 * Hi Shea,
 * Thank you very much for the explanation.
 * Have a good day,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Performance’ is closed to new replies.

 * ![](https://ps.w.org/code-snippets/assets/icon.svg?rev=2148878)
 * [Code Snippets](https://wordpress.org/plugins/code-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/code-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/code-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/code-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/code-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/code-snippets/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Cyrille Sanson](https://wordpress.org/support/users/css31/)
 * Last activity: [4 years ago](https://wordpress.org/support/topic/performance-58/#post-15651942)
 * Status: resolved