scinfu/SwiftSoup

SwiftSoup.parse is very slow

smallgirl opened this issue · 1 comments

AF.request("https://api.wogg.xyz/")
            .responseString(queue: .global(qos: .background), encoding: .utf8) { [weak self] response in
                guard let strongSelf = self else {
                    return
                }
                switch response.result {
                case let .success(data):
                    do {
                        print("parse----start")
                        let doc: Document = try SwiftSoup.parse(data)
                        print("parse----finish")
                        
                    } catch {
                        logVerbose(error)
                    }
                case let .failure(error):
                    logVerbose(error)
                }
            }

It took 7 seconds from start to finish of parsing

线程问题,切换一个线程就快了。