summaryrefslogtreecommitdiff
path: root/ext/erb
AgeCommit message (Collapse)Author
2022-11-27[ruby/erb] Skip using the extension for truffleruby as wellTakashi Kokubun
(https://github.com/ruby/erb/pull/39) * Skip using the extension for truffleruby as well * Just skip building the C extension for TruffleRuby * Skip rake compile for truffleruby * Use resolve_feature_path * Revert "Use resolve_feature_path" This reverts commit https://github.com/ruby/erb/commit/acc1e0c0ffaf. * Use resolve_feature_path with LoadError guard https://github.com/ruby/erb/commit/85dcb08439
2022-11-26[ruby/erb] Define ERB::Escape moduleTakashi Kokubun
(https://github.com/ruby/erb/pull/38) Close #32
2022-11-25[ruby/erb] Keep ERB::Util#html_escape privateTakashi Kokubun
ERB::Util.html_escape has been public, but ERB::Util#html_escape had been private. https://github.com/ruby/erb/commit/e62210bf56
2022-11-24[ruby/erb] Rename erb.so to erb/escape.soTakashi Kokubun
(https://github.com/ruby/erb/pull/35) https://github.com/ruby/erb/commit/1280046952
2022-11-05[ruby/erb] Revert the strpbrk optimizationTakashi Kokubun
because it's much slower on M1 https://github.com/ruby/erb/pull/29. It'd be too complicated to switch the implementation based on known optimized platforms / versions. Besides, short strings are the most common usages of this method and SIMD doesn't really help that case. All in all, I can't justify the existence of this code. https://github.com/ruby/erb/commit/30691c8995
2022-11-05[ruby/erb] Optimize away the rb_convert_type call using RB_TYPE_PTakashi Kokubun
https://github.com/ruby/erb/commit/12058c3784
2022-11-05[ruby/erb] Use strpbrk only when str is long enough for SIMDTakashi Kokubun
This is the same trick used by https://github.com/k0kubun/hescape to choose the best strategy for different scenarios. https://github.com/ruby/erb/commit/af26da2858
2022-11-05[ruby/erb] Optimize the no-escape case with strpbrkTakashi Kokubun
(https://github.com/ruby/erb/pull/29) Typically, strpbrk(3) is optimized pretty well with SIMD instructions. Just using it makes this as fast as a SIMD-based implementation for the no-escape case. Not utilizing this for escaped cases because memory allocation would be a more significant bottleneck for many strings anyway. Also, there'll be some overhead in calling a C function (strpbrk) many times because we're not using SIMD instructions directly. So using strpbrk all the time might not necessarily be faster.
2022-11-04[ruby/erb] Avoid using prepend + super for fallbackTakashi Kokubun
(https://github.com/ruby/erb/pull/28) `prepend` is prioritized more than ActiveSupport's monkey-patch, but the monkey-patch needs to work. https://github.com/ruby/erb/commit/611de5a865
2022-11-04[ruby/erb] Do not allocate a new String if not neededTakashi Kokubun
[Feature #19102]https://github.com/ruby/erb/commit/ecebf8075c
2022-11-04[ruby/erb] Optimize away to_s if it's already T_STRINGTakashi Kokubun
[Feature #19102]https://github.com/ruby/erb/commit/38c6e182fb
2022-11-04[ruby/erb] Copy CGI.escapeHTML to ERB::Util.html_escapeTakashi Kokubun
https://github.com/ruby/erb/commit/ac9b219fa9