mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-04 05:44:50 +00:00
Character check performance #316
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @MihaZupan on GitHub (Aug 6, 2019).
@xoofx I've gone through and added optimizations such as the one I mentioned on Twitter to helper methods in
CharHelper(there are other possible places where it could be used as well).In a microbenchmark, performance improvements are amazing, around:
~10% for
IsDigit,IsAlphaUpper~2-4x for
IsWhiteSpace,IsAlphaNumeric,IsPunctuationand other similar methods ...~10x for
IsEmailUsernameSpecialCharthat was implemented asstring.IndexOfSadly, in a real-world scenario, the difference is a 0-2% improvement.
@xoofx Do you think this is worth a PR?
@xoofx commented on GitHub (Oct 24, 2019):
Fixed by PR #377