https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112015-01-18T01:58:41ZRuby Issue Tracking SystemRuby master - Misc #10754: Tiny optimisation of Set#include?https://redmine.ruby-lang.org/issues/10754?journal_id=510822015-01-18T01:58:41Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p>This speedup probably happens because Hash#[] has an optimized dispatch<br>
VM instruction (opt_aref in insns.def) while Hash#include? does not.</p>
<p>Seems like an OK change to make, I'll commit in a few days unless others<br>
raise objections.</p> Ruby master - Misc #10754: Tiny optimisation of Set#include?https://redmine.ruby-lang.org/issues/10754?journal_id=511412015-01-20T22:51:02Zismael (Ismael Abreu)ismaelga@gmail.com
<ul></ul><p>With the benchmarks I've run I noticed that <del>sometimes</del> rarely, the old include? was faster.<br>
Do you have any idea why is that? The only cause I can think of is the GC.</p> Ruby master - Misc #10754: Tiny optimisation of Set#include?https://redmine.ruby-lang.org/issues/10754?journal_id=511932015-01-23T19:58:26Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p>I didn't notice the old code being faster, and I don't see your<br>
benchmark triggering GC. Perhaps it is related to memory size<br>
(swapping or CPU cache misses) or power management<br>
(CPU clock frequency adjustment, "turbo boost", etc...)<br>
Modern hardware is tricky to benchmark :/</p> Ruby master - Misc #10754: Tiny optimisation of Set#include?https://redmine.ruby-lang.org/issues/10754?journal_id=514702015-02-11T00:49:58Zismael (Ismael Abreu)ismaelga@gmail.com
<ul></ul><p>Any update on this?</p> Ruby master - Misc #10754: Tiny optimisation of Set#include?https://redmine.ruby-lang.org/issues/10754?journal_id=514712015-02-11T19:08:28Znormalperson (Eric Wong)normalperson@yhbt.net
<ul></ul><p>Thanks for the reminder, I got distracted with other stuff :x<br>
Committed r49568</p> Ruby master - Misc #10754: Tiny optimisation of Set#include?https://redmine.ruby-lang.org/issues/10754?journal_id=514732015-02-12T17:47:54Zismael (Ismael Abreu)ismaelga@gmail.com
<ul></ul><p>Awesome! :)</p>
<p>Shouldn't this issue be closed also?</p> Ruby master - Misc #10754: Tiny optimisation of Set#include?https://redmine.ruby-lang.org/issues/10754?journal_id=514762015-02-12T22:18:06Zmarcandre (Marc-Andre Lafortune)marcandre-ruby-core@marc-andre.ca
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Closed</i></li></ul>