Commit 16edb13
committed
Improve the Sequel benchmark to avoid many singleton classes
* These singleton classes are expensive to create and also cause a lot
of uncached method lookups.
* Both `Post.create` and `Post.where(id: i).first`
create a new singleton class per call (through #clone of a dataset
object which has a singleton class).
* With this commit, no singleton classes are created during insertion
and in `run_benchmark`. And therefore also no uncached method lookup.1 parent a6e3350 commit 16edb13
1 file changed
Lines changed: 9 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
58 | | - | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
62 | | - | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
0 commit comments