NSAttributedString from HTML data: slow and main thread only

Number:rdar://20978452 Date Originated:15/05/2015
Status:Open Resolved:
Product:iOS Product Version:8.3
Classification:Serious Bug Reproducible:Every time
-[NSAttributedString initWithData:options:documentAttributes:error] is slow and can crash if used in a background thread

Steps to Reproduce:
See attached example project that shows the slowness and the possible crash

Expected Results:
1. Fast conversion of a HTML string to a NSAttributedString
2. Usable from every thread

Actual Results:
1. VERY slow
2. Can crash in a background thread (because WebKit)

iOS 8.3

This has caused crashes, though this sample code doesn't seem to be producing them. In our proper app we were more likely to get crashes when trying to parse the html in app did finish launching, still unsure of why.

Tested on iPhone 5s and 6 running iOS 8.3


example project https://www.dropbox.com/sh/wnauco2dbzps3oq/AABEW1coTTyvyNsrBYB-7Q9va?dl=1

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!