[ 
https://issues.apache.org/jira/browse/HIVE-11544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14715546#comment-14715546
 ] 

Gopal V commented on HIVE-11544:
--------------------------------

Full benchmark results are rather interesting BIGINT is faster than INT.

{code}
Run result: 1843470000.00 ns/op (<= 2 samples)


# Run complete. Total time: 00:01:46

Benchmark                                                 Mode  Samples         
  Score   Error  Units
o.a.h.b.s.LazySimpleSerDeBench.GoodLazyByte.bench         avgt        2  
1433448000.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.GoodLazyDouble.bench       avgt        2   
161712500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.GoodLazyFloat.bench        avgt        2   
256967500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.GoodLazyInteger.bench      avgt        2   
649704000.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.GoodLazyLong.bench         avgt        2    
34384500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.GoodLazyShort.bench        avgt        2  
1464437000.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.RandomLazyByte.bench       avgt        2  
1403027000.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.RandomLazyDouble.bench     avgt        2  
1708506000.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.RandomLazyFloat.bench      avgt        2  
1788844000.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.RandomLazyInteger.bench    avgt        2  
1352076000.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.RandomLazyLong.bench       avgt        2  
1446379500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.RandomLazyShort.bench      avgt        2  
1562499500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.WorstLazyByte.bench        avgt        2  
1650849500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.WorstLazyDouble.bench      avgt        2  
2032039000.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.WorstLazyFloat.bench       avgt        2  
1948020500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.WorstLazyInteger.bench     avgt        2  
1862427500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.WorstLazyLong.bench        avgt        2  
1709320500.000 ±   NaN  ns/op
o.a.h.b.s.LazySimpleSerDeBench.WorstLazyShort.bench       avgt        2  
1843470000.000 ±   NaN  ns/op

$ expelliarmus:hive-jmh 
{code}

> LazyInteger should avoid throwing NumberFormatException
> -------------------------------------------------------
>
>                 Key: HIVE-11544
>                 URL: https://issues.apache.org/jira/browse/HIVE-11544
>             Project: Hive
>          Issue Type: Improvement
>          Components: Serializers/Deserializers
>    Affects Versions: 0.14.0, 1.2.0, 1.3.0, 2.0.0
>            Reporter: William Slacum
>            Assignee: Gopal V
>            Priority: Minor
>              Labels: Performance
>         Attachments: HIVE-11544.1.patch, HIVE-11544.2.patch, 
> HIVE-11544.3.patch
>
>
> {{LazyInteger#parseInt}} will throw a {{NumberFormatException}} under these 
> conditions:
> # bytes are null
> # radix is invalid
> # length is 0
> # the string is '+' or '-'
> # {{LazyInteger#parse}} throws a {{NumberFormatException}}
> Most of the time, such as in {{LazyInteger#init}} and {{LazyByte#init}}, the 
> exception is caught, swallowed, and {{isNull}} is set to {{true}}.
> This is generally a bad workflow, as exception creation is a performance 
> bottleneck, and potentially repeating for many rows in a query can have a 
> drastic performance consequence.
> It would be better if this method returned an {{Optional<Integer>}}, which 
> would provide similar functionality with a higher throughput rate.
> I've tested against 0.14.0, and saw that the logic is unchanged in 1.2.0, so 
> I've marked those as affected. Any version in between would also suffer from 
> this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to