Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPERF: avoid string allocations #17669
Conversation
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
its cutting down on a method invocation but this may be erased anyway, not sure, we can omit this |
This comment has been minimized.
This comment has been minimized.
@SamSaffron: I'm with @egilburg on this one, the PR doesn't make sense. |
SamSaffron
force-pushed the
SamSaffron:optimise_memory
branch
Nov 19, 2014
SamSaffron
force-pushed the
SamSaffron:optimise_memory
branch
to
a668b09
Nov 19, 2014
This comment has been minimized.
This comment has been minimized.
@thedarkone @egilburg @sgrif the impact of this is actually quite stark:
(ran in RAILS_ENV=production) Before
After
Its a very noticeable chunk of memory being allocated. |
This comment has been minimized.
This comment has been minimized.
@SamSaffron you changed the PR and now always do The only new thing now is the Under which conditions do you get a |
This comment has been minimized.
This comment has been minimized.
You get it arel nodes and arel attributes when constructing complex queries, Post.count generates an Arel::Nodes:Count , and the includes thingy generates an Arel::Attributes::Attribute |
This comment has been minimized.
This comment has been minimized.
@SamSaffron ok now it makes sense, thanks! |
This comment has been minimized.
This comment has been minimized.
np, thanks for reviewing sometimes I get a bit carried away with On Thu, Nov 20, 2014 at 11:02 AM, Eugene Gilburg notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
I still need to track down the source of the arel nodes coming through here, want to make sure there isn't a deeper problem. If there isn't this is |
This comment has been minimized.
This comment has been minimized.
OK, the revised a668b09 now makes sense. |
This comment has been minimized.
This comment has been minimized.
this makes sense to me |
SamSaffron commentedNov 18, 2014
I am pretty sure this is correct, its also more explicit about the behavior here.