Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increasing max_size significantly degrades performance. #55

Closed
jhlywa opened this issue Nov 27, 2012 · 1 comment
Closed

Increasing max_size significantly degrades performance. #55

jhlywa opened this issue Nov 27, 2012 · 1 comment
Assignees

Comments

@jhlywa
Copy link
Contributor

jhlywa commented Nov 27, 2012

Here's a simple contrived example:

-module(perf_ex).                                                                  
-compile(export_all).                                                              
-include_lib("proper/include/proper.hrl").                                         

-record(msg, {                                                                     
  a = 0 :: 0..16#ffffffff,                                                         
  b = 0 :: 0..16#f                                                                 
}).                                                                                
-type(msg() :: #msg{}).                                                            

-spec encode(msg()) -> binary().                                                   
encode(#msg{a = A, b = B}) -> <<A:32, B:4>>.                                       

-spec decode(binary()) -> msg().                                                   
decode(<<A:32, B:4>>) -> #msg{a=A, b=B}.                                           

prop_identity() -> ?FORALL(Msg, msg(), Msg =:= decode(encode(Msg))).               

And the results:

1> timer:tc(fun() -> proper:quickcheck(perf_ex:prop_identity(), [5, {max_size, 42}]) end).
.....                                                                              
OK: Passed 5 test(s).                                                              
{8170,true}                                                                        

2> timer:tc(fun() -> proper:quickcheck(perf_ex:prop_identity(), [5, {max_size, 16#ffffffff}]) end).
.....                                                                           
OK: Passed 5 test(s).                                                              
{658751072,true}                                                                   

I haven't been able to determine what's causing the slowdown, but it's significant. Any suggestions?

@ghost ghost assigned manopapad Feb 26, 2013
@manopapad
Copy link
Collaborator

Thanks for reporting this. The issue should be fixed now, let me know if it's still giving you trouble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants