Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Performance: angular.copy 1.2 vs 1.3 #11990

Closed
buihoanghai opened this issue Jun 1, 2015 · 4 comments
Closed

Performance: angular.copy 1.2 vs 1.3 #11990

buihoanghai opened this issue Jun 1, 2015 · 4 comments

Comments

@buihoanghai
Copy link

I have a issue with performance. When I upgrade my app angular 1.2 to 1.3. The app run very slow when digest a big data. $digest in 1.2 just 3s but in 1.3 it take about 10s. I checked and saw angular.copy in 1.2 is run faster than 1.3 2-3 times. You can check it in: http://jsfiddle.net/hoanghaibui2003/0npr2sqn/2/

@Narretz
Copy link
Contributor

Narretz commented Jun 8, 2015

We don't really encourage using the built-in helper methods, because they are mainly for internal purposes. So it's unlikely that we will prioritize fixing these perf regressions.

@Narretz
Copy link
Contributor

Narretz commented Jun 8, 2015

For what it's worth, it seems to be caused by supporting circular references since 1.3.0-beta.11: 083f496

@buihoanghai
Copy link
Author

I see in function digest line 14308 version 1.3.15 use "copy". It's mean if I watch a big object the digest will very slow than 1.2. Currently, I use JSON.parse(JSON.stringify(source)); for angular.copy and it run faster

@Narretz
Copy link
Contributor

Narretz commented Jan 22, 2016

The built-in helpers are not built for speed. copy is maybe an exception as it often used by the watch / digest mechanism. There's an issue about this here: #11099

@Narretz Narretz closed this as completed Jan 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants