[ 
https://issues.apache.org/jira/browse/AVRO-4114?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Perkins resolved AVRO-4114.
-------------------------------
    Fix Version/s: 1.13.0
       Resolution: Fixed

> [Ruby] Improve SchemaValidator.validate_simple method performance
> -----------------------------------------------------------------
>
>                 Key: AVRO-4114
>                 URL: https://issues.apache.org/jira/browse/AVRO-4114
>             Project: Apache Avro
>          Issue Type: Improvement
>            Reporter: Serg Tyatin
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.13.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> *WHY*
> The method `SchemaValidator.validate_simple` uses raise/rescue to add errors 
> to a result. Unfortunately, ruby raise/rescue is slow. 
> Example performance benchmark
> {quote}{{Benchmark.measure \{ 50000.times{ errors=[];begin;raise "aa" ; 
> rescue ;errors<< "error"; end }}}} => 2 seconds
> {{Benchmark.measure \{ 50000.times{ errors=[];begin; errors<< "error"; end 
> }}}} => 0.003 seconds
> {quote}
> 600x times faster
> The {{validate_simple}} method is in use for validation, and, more 
> importantly, it is called in a loop multiple times for union type encoding.
>  
> *WHAT*
> Rewrite {{validate_simple method without raise/rescu}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to