Github user drobakowski commented on the pull request:

    https://github.com/apache/thrift/pull/150#issuecomment-48805552
  
    Hi @Jens-G,
    
    absolutely, whatever it takes to get one or the other patch committed! :) I 
will try to show the main differences from my point of view.
    
    * ARC:
     * My patch is backward compatible with non ARC Objective-C code and uses 
the ```retain_stub/dealloc_stub/release_stub/autorelease_stub functions``` for 
dealing with memory allocs etc.
     * @guoyalun version is not.
    
    * In writeMessageBeginWithName:
    ```
    switch (messageType) {
        case TMessageType_CALL:
        case TMessageType_ONEWAY:
    …
    ```
    vs.
    ```
    if (messageType == TMessageType_CALL || messageType == TMessageType_ONEWAY) 
{
    …
    ```
    where i prefer my switch statement because it's a direct jump at runtime.
    
    ```
    NSMutableString * serviceFunction = [[NSMutableString alloc] 
initWithString:mServiceName];
    [serviceFunction appendString:MULTIPLEXED_SERVICE_SEPERATOR];
    [serviceFunction appendString:name];
    …
    ```
    vs.
    ```
    NSString *messageName = [NSString 
stringWithFormat:@"%@%@%@",_serviceName,SEPARATOR,name];
    ```
    I’m not sure which one is better and should be used according to 
memory/performance usage. According to memory usage, I think I've read 
somewhere that NSMutableString should perform better in this case but I don't 
have enough experience with Objective-C, @Jens-G, @guoyalun do you have some 
advice? Sure @guoyalun version looks cleaner.
    
    @guoyalun did I miss something, whats your opinion to the differences?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to