rmq
rmq copied to clipboard
RMQ tag selector performance
I'm writing a small app that has LOTS of buttons and I needed a neat way to be able to grab them individually quickly, so I was using tags, which was working great, but I noticed that as I increased the number of buttons I needed to grab, the app began to slow. I solved it by changing from tags to just storing references in a class instance variable (I need to grab things from various different places)
I've created a simple (quick and dirty) app that illustrates my problem: https://github.com/jjnevis/rmq_test The simple test shows a difference in performance in the order of 100 times. (type 'Test.run' in the REPL)
Now, I may be doing something silly - I'm no guru, but using the Class instance variable approach has worked for me, I just though I would bring this to your attention.
Cheers Jay
RMQ is very performance oriented, we'll be sure to check up on this, thanks for such a great report!
Thanks Jay. That's very helpful.
We can speed this up a lot, but it would mean keeping some state. I wonder if I can speed it up much if I don't cache the tags in a hash or something. I'll poke around.
It would be great to have a whole set of benchmarks like this, so we could start tweaking stuff in a methodical way.
I worked on this last night, I can speed it up some, but without benchmarks I don't know if I'm slowing down other scenarios. So I'll wait.
Are you not 'keeping some state' already if people use 'rmq(my_view).tag(:my_tag)'? Is there a big overhead of having a general rmq name/value pair bucket to store object references? I'm asking from a naive perspecive - I'm no expert, just trying to help.. I'm a big fan of your work!
You can see all the state stored on each View with my_view_object.rmq_data
If you are dealing with the RMQ wrapper, then you'll need to say rmq_object.get.rmq_data