Closed chriszielinski closed 4 years ago
1 Error | |
---|---|
:no_entry_sign: | Please include a CHANGELOG entry. You can find it at CHANGELOG.md. |
Generated by :no_entry_sign: Danger
Thanks, @chriszielinski! I will check asap.
Hi, the beauty of the lib is not using any other external lib. So I will keep this PR open until I have more time to improve the crawling. Thanks.
This PR is a proposition. May I recommend removing the reliance on
NSAttributedString
to decode HTML character entities in favor of the HTMLString library.Why?
Performance:
NSAttributedString
requires a large overhead (e.g.WebKit
) for such a relatively small purpose. Here is a performance comparison of decodingHTMLString
's TestData usingHTMLString
&NSAttributedString
, respectively.The performance tests ran are:
Concurrency: Using
NSAttributedString
requires the main thread. Not a problem for 99.9% of use cases; however, it becomes a problem when synchronous behavior is wanted (e.g. a command line interface). I'm sure there are some obscure ways around this, but given the performance implications themselves, why not kill two birds with one stone.That being said, this PR isn't ready yet. The changelog hasn't been updated nor has the SPM been tested—I'm sure there's other things as well. Just wanted to test the water first.