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

Validation + some RegEx cause very slow generation #292

Closed
TheJavaGuy opened this issue Feb 7, 2018 · 5 comments
Closed

Validation + some RegEx cause very slow generation #292

TheJavaGuy opened this issue Feb 7, 2018 · 5 comments

Comments

@TheJavaGuy
Copy link

Hello guys,

I noticed a case where generation of beans is very slow (almost a minute for one bean). That happens when beans use validation + regex, like this: @Pattern(regexp = "(.{1,6})( *, *(.{1,6})){0,15}") I use random-beans 3.7.0 and Hibernate validator 6.0.7.

I attached a minimal gradle/IntelliJ project which demonstrates the issue.
RandomBeansRegExIssue.zip

Now I am perfectly aware that people can create all sorts of nasty regexes and that's probably impossible to quickly generate a string which satifies them. Yet I hope that it's possible to speed up generation for some cases.

If you need any more info, help or whatever please contact me. Thank you!

@PascalSchumacher
Copy link
Collaborator

PascalSchumacher commented Feb 7, 2018

Hi Ivan,

thanks for reporting this. RandomBeans uses https://github.com/DiUS/java-faker which uses https://github.com/mifmif/Generex to generated data based on regular expressions.

Therefore this issue should be reported at https://github.com/mifmif/Generex

Thanks!

Edit: Noticed you have already done that, in mifmif/Generex#43

@TheJavaGuy
Copy link
Author

@PascalSchumacher Thank you for the answer! After a bit more research I found the Generex and opened an issue there. I'll close this now.

@ghilainm
Copy link

Seems like the project you depends on is dead. Would you maybe consider, moving to another one for generating regepx? Because it is unusable in the current state with such slow generation. On my side it simply never reach the end.

@fmbenhassine
Copy link
Member

fmbenhassine commented Apr 21, 2020

Seems like the project you depends on is dead. Would you maybe consider, moving to another one for generating regepx?

@ghilainm Definitely yes, do you know any good alternative?

@ghilainm
Copy link

Unfortunately no! If I come across that I keep you informed.

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

4 participants