summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2024-02-27 14:02:24 -0800
committerGitHub <noreply@github.com>2024-02-27 17:02:24 -0500
commit3668118572c8d1f8faa95034883b52aa9d05c5c4 (patch)
tree12937f6030d0e38cfaed4a4678ba42cbd27b65c6
parentedc7b73fc4755bb91ea16d1513993fbce5a6e244 (diff)
[DOC] Stop discouraging the use of Array#each (#10119)
-rw-r--r--doc/yjit/yjit.md2
1 files changed, 0 insertions, 2 deletions
diff --git a/doc/yjit/yjit.md b/doc/yjit/yjit.md
index 63588c2869..8aab1aed22 100644
--- a/doc/yjit/yjit.md
+++ b/doc/yjit/yjit.md
@@ -268,8 +268,6 @@ This section contains tips on writing Ruby code that will run as fast as possibl
- Avoid classes that wrap objects if you can
- Avoid methods that just call another method, trivial one-liner methods
- Try to write code so that the same variables always have the same type
-- Use `while` loops if you can, instead of C methods like `Array#each`
- - This is not idiomatic Ruby, but could help in hot methods
- CRuby method calls are costly. Avoid things such as methods that only return a value from a hash or return a constant.
You can also use the `--yjit-stats` command-line option to see which bytecodes cause YJIT to exit, and refactor your code to avoid using these instructions in the hottest methods of your code.