dataCompiler // Use GCD to boost compilation speed.
This commit is contained in:
parent
cf025b2b52
commit
e51ecfcc50
|
@ -552,12 +552,31 @@ func commonFileOutput() {
|
||||||
// MARK: - 主執行緒
|
// MARK: - 主執行緒
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
NSLog("// 準備編譯符號表情ㄅ文語料檔案。")
|
let globalQueue = DispatchQueue.global(qos: .default)
|
||||||
commonFileOutput()
|
let group = DispatchGroup()
|
||||||
NSLog("// 準備編譯繁體中文核心語料檔案。")
|
group.enter()
|
||||||
fileOutput(isCHS: false)
|
globalQueue.async {
|
||||||
NSLog("// 準備編譯簡體中文核心語料檔案。")
|
NSLog("// 準備編譯符號表情ㄅ文語料檔案。")
|
||||||
fileOutput(isCHS: true)
|
commonFileOutput()
|
||||||
|
group.leave()
|
||||||
|
}
|
||||||
|
group.enter()
|
||||||
|
globalQueue.async {
|
||||||
|
NSLog("// 準備編譯繁體中文核心語料檔案。")
|
||||||
|
fileOutput(isCHS: false)
|
||||||
|
group.leave()
|
||||||
|
}
|
||||||
|
group.enter()
|
||||||
|
globalQueue.async {
|
||||||
|
NSLog("// 準備編譯簡體中文核心語料檔案。")
|
||||||
|
fileOutput(isCHS: true)
|
||||||
|
group.leave()
|
||||||
|
}
|
||||||
|
// 一直等待完成
|
||||||
|
_ = group.wait(timeout: .distantFuture)
|
||||||
|
group.notify(queue: DispatchQueue.main) {
|
||||||
|
NSLog("// 全部辭典檔案建置完畢。")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Reference in New Issue