For example I have a list of 100 strings, and 100 span's with this strings. How do you think, how much span's takes more memory than array of strings. Is there possibility to measure? Is there optmisation to unvisible DOM?
-
Are you referring to the browser DOM? OR another implementation?Crescent Fresh– Crescent Fresh2009-11-29 15:14:15 +00:00Commented Nov 29, 2009 at 15:14
-
Yes, browser, FF, IE, Safari, Chrome, as alwaysIgor Golodnitsky– Igor Golodnitsky2009-11-29 15:48:12 +00:00Commented Nov 29, 2009 at 15:48
2 Answers
This is a very small amount of data. I suggest that you concentrate on the functionality first, instead of optimizing something that's probably quite fast :). If you encounter performance problems (and your profiler says that's the hot spot), do something about it. I think you're doing a little premature optimization here, which is described in detail both on the web and on Stackoverflow in general.
1 Comment
Have you considered doing a test to see this? If you use a browser like Chrome you have access to advanced memory related information.
It would seem that creating 100 strings would use around 400-600 byte's. 100 spans however would depend on the browsers implementation and how it handles memory allocation etc...