Is there a performance limitation for storing values โ€‹โ€‹in the web.config file compared to const fields?

There is currently an ApplicationConfiguration class in our application. This is basically just a static class with values constdefining some application-global configuration application configuration parameters. Some of these values โ€‹โ€‹will rarely ever change and will only be introduced into the configuration for elegance / cleanliness. Currently it is tightly attached to something like 100, which is good for all practical applications. โ†’

Some of these meanings, however, must be different between production and development. Therefore, I consider creating this class only with a wrapper over Web.config. These values โ€‹โ€‹are checked many times throughout our code base. If I changed them from constto read-only, which reads from Web.config, will this affect the compiler optimization or will make our application slower?

+3
source share
1 answer

Web.config values โ€‹โ€‹are read into memory once at the beginning of the application and stored there until the application terminates. So, there is no real difference in performance here - no additional file I / O operations repeating web.config.

, . web.config ( , ).

, . .

+1

Source: https://habr.com/ru/post/1761578/


All Articles