This is somewhat of a hard question, as I've been working to fix this for quite some time now, but I am running out of ideas.
The problem: The loading time for the page takes to long. It looks kinda "creepy". I've already compressed files, moved them together and all of this. But I am having a major problem, which I found no answer of:
https://i.imgur.com/jKzc7uy.jpg
I've removed some parts which delayed the page loading already. However, as you can see, from 600ms to 800ms and ~900ms to ~1500ms is completely empty. Nothing is loading. Thats almost 800s of a total of 1.88s loading time, which the page doesn't do anything.
How can I remove that empty space?
You can use this free tool provided by Google for ideas on improving page loading times for mobile and desktop:
https://developers.google.com/speed/pagespeed/insights/?hl=en&url=https%3A%2F%2Fm.imgur.com%2FjKzc7uy&tab=desktop
Related
Within the last few updates to Aurelia I've noticed increasingly bad load times. I'm not talking about bundling load times, but dev load times on localhost. The Aurelia motto was that it would get out of your way and only be there if you needed it. With a ~10 second load time for my page, that's not getting out of my way. Simply making style changes to my site is a tediously slow process now.
I checked the skeleton navigation sample app to make sure this wasn't related specifically to my "custom" version and I got the same load times. 107 requests and an average of 9.5 seconds to load the page. How is this acceptable for even a dev environment?
Is there a way to bundle just the Aurelia code so it's "out of my way"? Again, this has only happened within the last few releases of Aurelia. I don't know which one specifically because it felt like such a gradual increase and only now am I noticing these long load times.
Edit
I did take note that these long load times started shortly after I updated Chrome and FireFox. I'm not sure if it's actually related, but I noticed big slowdowns after the update, specifically in Chrome (I use Chrome for the majority of my dev work).
For reference, here's the log. It seems there are two culprits taking up the majority of the time.
Everything evens out after that.
The results:
I noticed my program was using an absurd (and ever-increasing) amount of memory, and managed to narrow it down to this piece of code:
Dim elements As HtmlElementCollection = wb.Document.GetElementsByTagName("div")
For Each ce As HtmlElement In elements
If ce.GetAttribute("hidden") = "false" Then ce.Style = "Display:none"
Marshal.ReleaseComObject(ce.DomElement)
Next
I'm using it to hide some specific elements on a webpage loaded by a WebBrowser control. I'm accessing a lot of webpages sequentially using a new WebBrowser instance each time (making sure to dispose of it afterwards), which means the above code gets run pretty frequently.
After commenting it out, memory usage stays relatively low and constant. But as soon as I add the code back in, memory usage increases dramatically, and keeps growing without ever going back down again.
I added the "Marshal.ReleaseComObject(ce.DomElement)" line after doing some research about the issue, and it's helped, albeit slightly-- memory usage still increases until the program crashes.
Again, everything works fine when I comment this section of code out, so I can verify the problem isn't being caused by some other oversight elsewhere.
Does anyone know what I could do to fix this, or know of some alternative method I can use to accomplish the same thing without the memory issue?
Edit: Also, I just want to point out that using a WebClient is out of the question-- I need the webpage to be rendered so I can take a screenshot.
Edit #2: In case anyone else is having a similar problem, I ended up using JavaScript instead, to the same effect:
wb.Navigate("document.getElementsByClassName('item')[0].setAttribute('style','display:none');")
That fixed the memory issue. However, I'm still interested in knowing why the original method used up so much memory, and how I could avoid that in the future...
So my I swear by PHPStorm, I have been using it for over a year now and have had no issues up until now.
I have now come to slight problem in the form of sluggish editing.
I have a model file that is just under 4000 lines of code - nothing too big, but PHPStorm seems to be having some trouble with it. My other models seem to be just fine, but this one goes sluggish every few seconds while editing. Meaning, it will let me start typing and editing the code, but then it will freeze briefly for a few seconds and then complete the actions I entered... like lag.
I am assuming it has something to do with the fact that it's an SQL file since I have other control files that are larger.
Ultimate, I guess I can reduce the model in size to be separated into other models, but I would rather not.
Anyone else have experience with this?
Thanks
B
I'm still fighting with memory leak. Using improved MemoryDiagnosticsHelper, i added possibility to make datastamps to see immediate memory cunsumption.
Problem starts at full app: i have a pivot with 3 items, 2 of them containing list of 10-20 objects (with possibility to jump to item details). Memory diagnostic shows, that it consumes about 50Mb of memory. After jumping to detail page and returning to pivot, memory consumption easily grows to 70Mb.
At first, i moved list to separate app. Without style, it takes 15 Mbs. I didnt check yet, but i assume, 2 lists in pivot would take about 20Mbs, because dlls are already loaded.
So, i decided to go deeper into app loading stage.
At the InitializePhoneApplication(), it takes 7 Mb.
At the CompleteInitializePhoneApplication(), it takes 8.5 Mb with empty ViewModelLocator, or 10.5 Mb with all viewmodels. Quite large, but i have 30-40 dataservices and 40-50 viewmodels. So let it be, i'd feel myself pretty ok, if it would not grow anymore.
At the first page's OnNavigatedTo(), it takes almost the same, kinda 10.7 Mb with all VMs, that's ok.
???
No profit. Seriously, what happens next? I cant see, what exactly is going on next, but MemoryDiagnosticsHelper says, that memory consumption jumps to 30 Mbs. Why? All dlls and VMs are already loaded. I'm just loading a very empty page, totally white.
Profiler (running in release mode, of course), is also helpless. It just shows growth in memory consumption, but it happens in non-managed memory. It annoys alot, really.
Ok, lets make question more clean. What happens next, when app is initialized (passed initialization, and viewmodel loaded and attached, and page passed OnNavigatedTo())?
EDIT 1: in the night, i got and idea, that the only weak part in my app (at least, that master-detail pages) is MVVMLight's EventToCommand. Almost first article in google is http://atomaras.wordpress.com/2012/04/23/solving-mvvmlights-eventtocommand-memory-leak-wp7/ Anybody knows, if it is alreasy fixed? I checked MvvmLight's blog, and looking like Laurent is working on installer for now. That pushes me to idea, that this leak should be already solved, isnt it?
EDIT 2: i see 2 solutions for leaking problem: either to use fix from the link above, or call commands from the codebehind. Or use another MVVM lib.
References.
I expected them to be loaded smoothier, during first stages of app init. Also, now it is clear, why profiler said that there's not that much managed code in the memory.
here is the url send by solrnet
http://localhost:8983/m_review/maincore/select?facet.field=p_catalog_id&facet=true&fq=p_B2BShow%3a%5b1+TO+*%5d&fq=p_review_type%3a1&sort=p_review_date+desc&rows=4&q=%3a&?
the url always ends with &?
and the costed time during the search is 10 times slower than the normal url
how to solve this problem?
thanks in advance
It may be a bug, but I've never seen any perf or behavior difference because of it. Solr just ignores it.
You might want to try compiling the latest source and see if it fixes your issue. But as I said, I really doubt that's the real cause of a 10x slowdown.