diff options
Diffstat (limited to 'perf/jsonPerfSpec.js')
| -rw-r--r-- | perf/jsonPerfSpec.js | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/perf/jsonPerfSpec.js b/perf/jsonPerfSpec.js index 01a489e2..edc4b6b2 100644 --- a/perf/jsonPerfSpec.js +++ b/perf/jsonPerfSpec.js @@ -1,28 +1,16 @@ describe('json', function() { it('angular parser', function() { - var duration = time(function() { - expect(angular.fromJson(largeJsonString)).toBeTruthy(); - }, 1); - - dump(duration/1 + ' ms per iteration'); - }); - - - it('angular delegating to native parser', function() { - var duration = time(function() { - expect(angular.fromJson(largeJsonString, true)).toBeTruthy(); - }, 100); - - dump(duration/100 + ' ms per iteration'); - }); - - - it('native json', function() { - var duration = time(function() { - expect(JSON.parse(largeJsonString)).toBeTruthy(); - }, 100); - - dump(duration/100 + ' ms per iteration'); + perf( + function angular() { + fromJson(largeJsonString); + }, + function nativeDelegate() { + fromJson(largeJsonString, true); + }, + function nativeJSON() { + JSON.parse(largeJsonString); + } + ); }); }); |
