Add HTMLKit Parser Performance test

This tests measures the parsing time of the HTML Living Standard page, about 8.1MB in
size (as of 23 October 2014)
This commit is contained in:
iska
2015-04-12 18:21:12 +02:00
parent af55cf01cb
commit 0911e46dba
3 changed files with 50 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
//
// HTMLKitParserPerformance.m
// HTMLKit
//
// Created by Iska on 11/04/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import <XCTest/XCTest.h>
#import "HTMLParser.h"
@interface HTMLKitParserPerformance : XCTestCase
@end
@implementation HTMLKitParserPerformance
- (void)testParserPerformance
{
NSString *path = [[NSBundle bundleForClass:self.class] resourcePath];
path = [path stringByAppendingPathComponent:@"HTML Standard.html"];
NSString *string = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
[self measureBlock:^{
HTMLParser *parser = [[HTMLParser alloc] initWithString:string];
[parser parseDocument];
}];
}
@end