ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:67664] [ruby-trunk - Misc #10754] [Open] Tiny optimisation of Set#include?
       [not found] <redmine.issue-10754.20150118012901@ruby-lang.org>
@ 2015-01-18  1:29 ` ismaelga
  2015-01-18  1:51   ` [ruby-core:67665] " Eric Wong
  2015-01-18  1:58 ` [ruby-core:67667] [ruby-trunk - Misc #10754] " normalperson
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: ismaelga @ 2015-01-18  1:29 UTC (permalink / raw
  To: ruby-core

Issue #10754 has been reported by Ismael Abreu.

----------------------------------------
Misc #10754: Tiny optimisation of Set#include?
https://bugs.ruby-lang.org/issues/10754

* Author: Ismael Abreu
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Hi!

I'm not sure if this a relevant optimisation but here it goes. A simple way to improve Set#include?
I don't think there should be any side effects with this change.

Here are some dummy benchmarks https://gist.github.com/ismaelga/68bb3ea51b4742f65699
They are not consistent, but that should be because of garbage collection or something. Right?

I've also sent a Pull Request: https://github.com/ruby/ruby/pull/810

---Files--------------------------------
patch.diff (544 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:67665] Re: [ruby-trunk - Misc #10754] [Open] Tiny optimisation of Set#include?
  2015-01-18  1:29 ` [ruby-core:67664] [ruby-trunk - Misc #10754] [Open] Tiny optimisation of Set#include? ismaelga
@ 2015-01-18  1:51   ` Eric Wong
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Wong @ 2015-01-18  1:51 UTC (permalink / raw
  To: Ruby developers

This speedup probably happens because Hash#[] has an optimized dispatch
VM instruction (opt_aref in insns.def) while Hash#include? does not.

Seems like an OK change to make, I'll commit in a few days unless others
raise objections.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:67667] [ruby-trunk - Misc #10754] Tiny optimisation of Set#include?
       [not found] <redmine.issue-10754.20150118012901@ruby-lang.org>
  2015-01-18  1:29 ` [ruby-core:67664] [ruby-trunk - Misc #10754] [Open] Tiny optimisation of Set#include? ismaelga
@ 2015-01-18  1:58 ` normalperson
  2015-01-20 22:51 ` [ruby-core:67709] " ismaelga
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: normalperson @ 2015-01-18  1:58 UTC (permalink / raw
  To: ruby-core

Issue #10754 has been updated by Eric Wong.


 This speedup probably happens because Hash#[] has an optimized dispatch
 VM instruction (opt_aref in insns.def) while Hash#include? does not.
 
 Seems like an OK change to make, I'll commit in a few days unless others
 raise objections.

----------------------------------------
Misc #10754: Tiny optimisation of Set#include?
https://bugs.ruby-lang.org/issues/10754#change-51082

* Author: Ismael Abreu
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Hi!

I'm not sure if this a relevant optimisation but here it goes. A simple way to improve Set#include?
I don't think there should be any side effects with this change.

Here are some dummy benchmarks https://gist.github.com/ismaelga/68bb3ea51b4742f65699
They are not consistent, but that should be because of garbage collection or something. Right?

I've also sent a Pull Request: https://github.com/ruby/ruby/pull/810

---Files--------------------------------
patch.diff (544 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:67709] [ruby-trunk - Misc #10754] Tiny optimisation of Set#include?
       [not found] <redmine.issue-10754.20150118012901@ruby-lang.org>
  2015-01-18  1:29 ` [ruby-core:67664] [ruby-trunk - Misc #10754] [Open] Tiny optimisation of Set#include? ismaelga
  2015-01-18  1:58 ` [ruby-core:67667] [ruby-trunk - Misc #10754] " normalperson
@ 2015-01-20 22:51 ` ismaelga
  2015-01-23 19:57   ` [ruby-core:67768] " Eric Wong
  2015-01-23 19:58 ` [ruby-core:67769] " normalperson
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 10+ messages in thread
From: ismaelga @ 2015-01-20 22:51 UTC (permalink / raw
  To: ruby-core

Issue #10754 has been updated by Ismael Abreu.


With the benchmarks I've run I noticed that ~~sometimes~~ rarely, the old include? was faster.
Do you have any idea why is that? The only cause I can think of is the GC.

----------------------------------------
Misc #10754: Tiny optimisation of Set#include?
https://bugs.ruby-lang.org/issues/10754#change-51141

* Author: Ismael Abreu
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Hi!

I'm not sure if this a relevant optimisation but here it goes. A simple way to improve Set#include?
I don't think there should be any side effects with this change.

Here are some dummy benchmarks https://gist.github.com/ismaelga/68bb3ea51b4742f65699
They are not consistent, but that should be because of garbage collection or something. Right?

I've also sent a Pull Request: https://github.com/ruby/ruby/pull/810

---Files--------------------------------
patch.diff (544 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:67768] Re: [ruby-trunk - Misc #10754] Tiny optimisation of Set#include?
  2015-01-20 22:51 ` [ruby-core:67709] " ismaelga
@ 2015-01-23 19:57   ` Eric Wong
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Wong @ 2015-01-23 19:57 UTC (permalink / raw
  To: Ruby developers

I didn't notice the old code being faster, and I don't see your
benchmark triggering GC.  Perhaps it is related to memory size
(swapping or CPU cache misses) or power management
(CPU clock frequency adjustment, "turbo boost", etc...)
Modern hardware is tricky to benchmark :/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:67769] [ruby-trunk - Misc #10754] Tiny optimisation of Set#include?
       [not found] <redmine.issue-10754.20150118012901@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2015-01-20 22:51 ` [ruby-core:67709] " ismaelga
@ 2015-01-23 19:58 ` normalperson
  2015-02-11  0:49 ` [ruby-core:68088] [Ruby trunk " ismaelga
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: normalperson @ 2015-01-23 19:58 UTC (permalink / raw
  To: ruby-core

Issue #10754 has been updated by Eric Wong.


 I didn't notice the old code being faster, and I don't see your
 benchmark triggering GC.  Perhaps it is related to memory size
 (swapping or CPU cache misses) or power management
 (CPU clock frequency adjustment, "turbo boost", etc...)
 Modern hardware is tricky to benchmark :/

----------------------------------------
Misc #10754: Tiny optimisation of Set#include?
https://bugs.ruby-lang.org/issues/10754#change-51193

* Author: Ismael Abreu
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Hi!

I'm not sure if this a relevant optimisation but here it goes. A simple way to improve Set#include?
I don't think there should be any side effects with this change.

Here are some dummy benchmarks https://gist.github.com/ismaelga/68bb3ea51b4742f65699
They are not consistent, but that should be because of garbage collection or something. Right?

I've also sent a Pull Request: https://github.com/ruby/ruby/pull/810

---Files--------------------------------
patch.diff (544 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:68088] [Ruby trunk - Misc #10754] Tiny optimisation of Set#include?
       [not found] <redmine.issue-10754.20150118012901@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2015-01-23 19:58 ` [ruby-core:67769] " normalperson
@ 2015-02-11  0:49 ` ismaelga
  2015-02-11 19:04   ` [ruby-core:68090] " Eric Wong
  2015-02-12 17:47 ` [ruby-core:68094] " ismaelga
  2015-02-12 22:18 ` [ruby-core:68097] [Ruby trunk - Misc #10754] [Closed] " ruby-core
  6 siblings, 1 reply; 10+ messages in thread
From: ismaelga @ 2015-02-11  0:49 UTC (permalink / raw
  To: ruby-core

Issue #10754 has been updated by Ismael Abreu.


Any update on this?

----------------------------------------
Misc #10754: Tiny optimisation of Set#include?
https://bugs.ruby-lang.org/issues/10754#change-51470

* Author: Ismael Abreu
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Hi!

I'm not sure if this a relevant optimisation but here it goes. A simple way to improve Set#include?
I don't think there should be any side effects with this change.

Here are some dummy benchmarks https://gist.github.com/ismaelga/68bb3ea51b4742f65699
They are not consistent, but that should be because of garbage collection or something. Right?

I've also sent a Pull Request: https://github.com/ruby/ruby/pull/810

---Files--------------------------------
patch.diff (544 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:68090] Re: [Ruby trunk - Misc #10754] Tiny optimisation of Set#include?
  2015-02-11  0:49 ` [ruby-core:68088] [Ruby trunk " ismaelga
@ 2015-02-11 19:04   ` Eric Wong
  0 siblings, 0 replies; 10+ messages in thread
From: Eric Wong @ 2015-02-11 19:04 UTC (permalink / raw
  To: Ruby developers

Thanks for the reminder, I got distracted with other stuff :x
Committed r49568

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:68094] [Ruby trunk - Misc #10754] Tiny optimisation of Set#include?
       [not found] <redmine.issue-10754.20150118012901@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2015-02-11  0:49 ` [ruby-core:68088] [Ruby trunk " ismaelga
@ 2015-02-12 17:47 ` ismaelga
  2015-02-12 22:18 ` [ruby-core:68097] [Ruby trunk - Misc #10754] [Closed] " ruby-core
  6 siblings, 0 replies; 10+ messages in thread
From: ismaelga @ 2015-02-12 17:47 UTC (permalink / raw
  To: ruby-core

Issue #10754 has been updated by Ismael Abreu.


Awesome! :)

Shouldn't this issue be closed also?

----------------------------------------
Misc #10754: Tiny optimisation of Set#include?
https://bugs.ruby-lang.org/issues/10754#change-51473

* Author: Ismael Abreu
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Hi!

I'm not sure if this a relevant optimisation but here it goes. A simple way to improve Set#include?
I don't think there should be any side effects with this change.

Here are some dummy benchmarks https://gist.github.com/ismaelga/68bb3ea51b4742f65699
They are not consistent, but that should be because of garbage collection or something. Right?

I've also sent a Pull Request: https://github.com/ruby/ruby/pull/810

---Files--------------------------------
patch.diff (544 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [ruby-core:68097] [Ruby trunk - Misc #10754] [Closed] Tiny optimisation of Set#include?
       [not found] <redmine.issue-10754.20150118012901@ruby-lang.org>
                   ` (5 preceding siblings ...)
  2015-02-12 17:47 ` [ruby-core:68094] " ismaelga
@ 2015-02-12 22:18 ` ruby-core
  6 siblings, 0 replies; 10+ messages in thread
From: ruby-core @ 2015-02-12 22:18 UTC (permalink / raw
  To: ruby-core

Issue #10754 has been updated by Marc-Andre Lafortune.

Status changed from Open to Closed

----------------------------------------
Misc #10754: Tiny optimisation of Set#include?
https://bugs.ruby-lang.org/issues/10754#change-51476

* Author: Ismael Abreu
* Status: Closed
* Priority: Normal
* Assignee: 
----------------------------------------
Hi!

I'm not sure if this a relevant optimisation but here it goes. A simple way to improve Set#include?
I don't think there should be any side effects with this change.

Here are some dummy benchmarks https://gist.github.com/ismaelga/68bb3ea51b4742f65699
They are not consistent, but that should be because of garbage collection or something. Right?

I've also sent a Pull Request: https://github.com/ruby/ruby/pull/810

---Files--------------------------------
patch.diff (544 Bytes)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-02-12 22:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-10754.20150118012901@ruby-lang.org>
2015-01-18  1:29 ` [ruby-core:67664] [ruby-trunk - Misc #10754] [Open] Tiny optimisation of Set#include? ismaelga
2015-01-18  1:51   ` [ruby-core:67665] " Eric Wong
2015-01-18  1:58 ` [ruby-core:67667] [ruby-trunk - Misc #10754] " normalperson
2015-01-20 22:51 ` [ruby-core:67709] " ismaelga
2015-01-23 19:57   ` [ruby-core:67768] " Eric Wong
2015-01-23 19:58 ` [ruby-core:67769] " normalperson
2015-02-11  0:49 ` [ruby-core:68088] [Ruby trunk " ismaelga
2015-02-11 19:04   ` [ruby-core:68090] " Eric Wong
2015-02-12 17:47 ` [ruby-core:68094] " ismaelga
2015-02-12 22:18 ` [ruby-core:68097] [Ruby trunk - Misc #10754] [Closed] " ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).