{"id":12039,"date":"2022-07-15T07:04:18","date_gmt":"2022-07-15T07:04:18","guid":{"rendered":"https:\/\/www.itwriting.com\/blog\/?p=12039"},"modified":"2022-07-15T07:04:18","modified_gmt":"2022-07-15T07:04:18","slug":"web-page-memory-usage-how-much-is-too-much","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/12039-web-page-memory-usage-how-much-is-too-much.html","title":{"rendered":"Web page memory usage: how much is too much?"},"content":{"rendered":"<p>I have a web application that loads names into a picklist and the question came up: how many names would be too much for the web page to handle? What about 5,000 names, for example?<\/p>\n<p>Modern web browsers have a memory snapshot built in. Just press F12 and there it is. So I fired up my application with over 5,000 names loaded into an array and displayed in a scrolling div. 2.5 MB.<\/p>\n<p>Then I visited Facebook. Logged in, the page reported over 78 MB.<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2022\/07\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"342\" height=\"105\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2022\/07\/image_thumb.png\" border=\"0\"><\/a><\/p>\n<p>Google\u2019s clean-looking home page? Not logged in, 11.2 MB.<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2022\/07\/image-1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"343\" height=\"91\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2022\/07\/image_thumb-1.png\" border=\"0\"><\/a><\/p>\n<p>Twitter? Logged in, 83 MB.<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2022\/07\/image-2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"336\" height=\"101\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2022\/07\/image_thumb-2.png\" border=\"0\"><\/a><\/p>\n<p>This was enough for me to stop worrying about the memory impact of 5,000 names in my web application. With our casual acceptance of multi-MB web pages it is easy to forget that the complete works of Shakespeare <a href=\"https:\/\/www.gutenberg.org\/ebooks\/100\" target=\"_blank\" rel=\"noopener\">in plain text<\/a> is 5.5 MB and compresses to less than half of that. <\/p>\n<p>Just because you can do something, does not mean you should. Smaller is better and faster, and software bloat of various kinds is responsible for many performance issues.<\/p>\n<p>There are trade-offs though both in time and in performance. Maybe it is better to load just a few names, and retrieve more from the server when needed. It is easy to test such things. Nevertheless, I found it useful to get some perspective on the memory usage of modern web sites.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a web application that loads names into a picklist and the question came up: how many names would be too much for the web page to handle? What about 5,000 names, for example? Modern web browsers have a memory snapshot built in. Just press F12 and there it is. So I fired up &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/12039-web-page-memory-usage-how-much-is-too-much.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Web page memory usage: how much is too much?<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[67,80,1519],"tags":[1592,849,977],"class_list":["post-12039","post","type-post","status-publish","format-standard","hentry","category-professional","category-software-development","category-tech","tag-javacript","tag-software-development","tag-web-development"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/12039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=12039"}],"version-history":[{"count":1,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/12039\/revisions"}],"predecessor-version":[{"id":12040,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/12039\/revisions\/12040"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=12039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=12039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=12039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}