summaryrefslogtreecommitdiff
path: root/ext/erb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/erb] Skip using the extension for truffleruby as wellTakashi Kokubun2022-11-271-1/+6
| | | | | | | | | | | | | | | | | | | | (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
* [ruby/erb] Define ERB::Escape moduleTakashi Kokubun2022-11-261-3/+3
| | | | | (https://github.com/ruby/erb/pull/38) Close #32
* [ruby/erb] Keep ERB::Util#html_escape privateTakashi Kokubun2022-11-251-1/+1
| | | | | | | ERB::Util.html_escape has been public, but ERB::Util#html_escape had been private. https://github.com/ruby/erb/commit/e62210bf56
* [ruby/erb] Rename erb.so to erb/escape.soTakashi Kokubun2022-11-243-3/+3
| | | | | | (https://github.com/ruby/erb/pull/35) https://github.com/ruby/erb/commit/1280046952
* [ruby/erb] Revert the strpbrk optimizationTakashi Kokubun2022-11-051-5/+0
| | | | | | | | | | | | 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
* [ruby/erb] Optimize away the rb_convert_type call using RB_TYPE_PTakashi Kokubun2022-11-051-1/+3
| | | | https://github.com/ruby/erb/commit/12058c3784
* [ruby/erb] Use strpbrk only when str is long enough for SIMDTakashi Kokubun2022-11-051-5/+7
| | | | | | | 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
* [ruby/erb] Optimize the no-escape case with strpbrkTakashi Kokubun2022-11-051-5/+8
| | | | | | | | | | | | | (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.
* [ruby/erb] Avoid using prepend + super for fallbackTakashi Kokubun2022-11-041-4/+8
| | | | | | | | | (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
* [ruby/erb] Do not allocate a new String if not neededTakashi Kokubun2022-11-041-4/+4
| | | | | [Feature #19102]https://github.com/ruby/erb/commit/ecebf8075c
* [ruby/erb] Optimize away to_s if it's already T_STRINGTakashi Kokubun2022-11-041-9/+2
| | | | | [Feature #19102]https://github.com/ruby/erb/commit/38c6e182fb
* [ruby/erb] Copy CGI.escapeHTML to ERB::Util.html_escapeTakashi Kokubun2022-11-042-0/+98
https://github.com/ruby/erb/commit/ac9b219fa9