[ 
https://issues.apache.org/jira/browse/AVRO-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698988#action_12698988
 ] 

Hong Tang edited comment on AVRO-12 at 4/14/09 4:56 PM:
--------------------------------------------------------

Looks good. There may be some room of improvement by eliminating the thread 
local variables (e.g. by having an internal interface 
Schema.equalsInternal(Schema other, Set<SeenPair> seen) and implement it for 
all composite schemas (Map, Record, Array)). But I doubt that full schema 
comparison will be a frequent operation, so the added code complexity is hardly 
worth it.

Also, just for fun, theoretically, the worst case time complexity could be 
O(n^4), and space complexity O(n^2) - but in normal situations, they should run 
in O( n ) time and space complexity.

      was (Author: hong.tang):
    Looks good. There may be some room of improvement by eliminating the thread 
local variables (e.g. by having an internal interface 
Schema.equalsInternal(Schema other, Set<SeenPair> seen) and implement it for 
all composite schemas (Map, Record, Array)). But I doubt that full schema 
comparison will be a frequent operation, so the added code complexity is hardly 
worth it.

Also, just for fun, theoretically, the worst case time complexity could be 
O(n^4), and space complexity O(n^2) - but in normal situations, they should run 
in O(n) time and space complexity.
  
> Bug in comparison of recurisive schemas
> ---------------------------------------
>
>                 Key: AVRO-12
>                 URL: https://issues.apache.org/jira/browse/AVRO-12
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.0
>            Reporter: Hong Tang
>            Assignee: Doug Cutting
>             Fix For: 1.0
>
>         Attachments: AVRO-12.patch
>
>
> Comparison of recursive schema will lead to infinite recursion (eventually 
> leading to java.lang.StackOverflowError.)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to