How to find the cause of slow performance in AngularJS? - angularjs

I noticed my app becoming quite slow with increasing amounts of data.
I thought it is because of some filters in ng-repeats that are triggered too often, but I've optimized them already and there's still no sign of performance improvement.
Then I thought it's database slowness, but it turns out that wasn't the case either.
I'd like to stop guessing where the slowness is coming from and find the cause systematically.
Does anyone know how to do this?
I just see tons of optimizations articles everywhere, but first I want to find out what part of the code needs the optimization.
I ran this Chrome analysis - and it seems to me that there's some AngularJS functions that take forever, but I don't know how to find out what's causing them.
No idea how this can help me. Looks like there's a function call that takes 4.5 seconds...
I'd like to get rid of it :D :D

I guess I was thinking too complicated...
I found the cause of the slowness simply by commenting everything out and commenting it in again step by step until the first slowness appeared :D

Related

Is it normal to need to restart Solr/Apache regularly?

It seems like about once every 2 to 3 months or so something about our solr implementation breaks down. Most recently the process we use to reindex our solr cores broke. It's a console application that just does two things: 1) Clear the indexes, 2) Rebuild the indexes. That's it, and it just does it by issuing http web requests to the server.
I was getting a 500 response when it was trying to clear the 1st core. None of the other cores had a problem though (except for the fact that they came after the 1st one and it is a synchronous process so nothing got reindexed). I spent a little time troubleshooting but ultimately I just restarted apache and it worked.
That seems to be the solution for everything. I wish I could remember previous issues I've run into, but something a little different seems to happen each time and it's always just much easier to reset apache than to spend the time to troubleshoot (plus it always happens in production and so spending hours troubleshooting isn't really a good option if I can fix it in seconds).
I wish these issues happened in staging or development where I could take time to investigate further, but it's always in production. So I'm starting to wonder if I should just create a task to reset Apache server every night.
When I reset it and it just suddenly works normally without me having to make a single change, I really have to wonder about the stability of Solr. Is this normal for others who use solr?

Relayjs performance really bad, setVariables

Does anyone know what causes these huge blocking functions in Relay when making requests? I have a search box that calls setVariables and it's immensely noticeable.
It's much better in production. Still curious though

How to build a weekly programmable web-based timer?

I am trying to figure out what is the best possible solution to create a website to function as a weekly programmable timer; after searching many hours I keep coming up empty handed.
I tried to start development on a web page. This is where I wound up:
http://www.gstrip.tk
I have a complete lack of knowledge on how to progress from this point.
How do I store the timers?
How do I make the server search for timers.
Then how do I execute a function such as a simple html request when the stored time for that day matches the current time?
This has been a huge stumbling block for me I assumed there would be an open source web based weekly programmable timer somewhere that I could modify but it appears nearly to be not available.
If it is already posted could you provide a link or something anything as I have searched fairly regularly the last couple of weeks with no results using different terms both on google and on stack. Maybe the syntax of my search is wrong somehow and this may be the reason for the lack of results IDK but I could sure use someone who is understanding and willing to level with me on this issue.

how to find "bottleneck"?

I have an WPF application, which do very slow an operation. The same operation does quickly second time. This operation uses third-party components. Seems, it's loading some libraries or something else. How can I found, what happens to fix it?
The simplest possible thing you can do is watch the output window while it is running in the Debugger. This will write a line for each assembly that is loaded so if your theory is correct then you will see lots of lines added while the slowness occurs.
In my experience this isn't the usual cause of delays such as this.
A far better solution is to get hold of a profiler, there are quite a few out there with trial periods so you can evaluate which most meets your needs, see Ants from redgate or DotTrace by Jetbrains. These will let you find out exactly where the delays are occuring.

Visual Studio 2012 in profiling mode gives much better performance

I have come across a strange situation and do not know what or how to look for.
We are having a Silverlight project hosted in a web project. This Silverlight project communicates using REST services hosted by the web project.
Now when we run this in debug mode, Everything runs fine as expected. So I thought of profiling it and checking which all places I might be loosing performance. So here is the interesting part.
I ran VS2012 Profiler and its is collecting all information related to methods executed, time and so on. But this time my project is lightning fast. Queries which used to take under normal debug about 1 sec to execute are now taking less than 200ms. There is one very intensive query which takes about 20 sec to execute in normal mode, but under profiling it takes less than 600ms.
So what I make out of this is that my code and project is capable of running this fast but for some reason it is not that fast under normal debug scenarios.
Can somebody throw light as what is happening under the hood and how can I achieve this performance in normal scenarios.
I would also like to mention that I have also tried release mode and publishing to IIS but none of these give as good performance as when in profiling mode.
Technically what I thought earlier is under profiling mode, performance should be less than normal as at that instant VS2012 is also collection other data.
I am confused. Please help.
Thanks
I know you probably don't need help at this point, but for anyone else who stumbles upon this post, I'll give my two cents.
I had this same problem with an XNA project I'm working on. Debug and Release modes both saw MASSIVE slowdowns in a certain situations. It pulled me down to less than 1 FPS. I was trying to profile the problem to solve it, but the issue never occurred during profiling.
I finally discovered the slowdowns were caused by a Console.WriteLine() I was calling in the situation. Commenting it out solved the issues on both Debug and Release build. Apparently, Console.WriteLine is just INCREDIBLY slow.

Resources