-
Notifications
You must be signed in to change notification settings - Fork 76
Open
Description
Hello @mifmif ,
I noticed one issue when generating some RegExps. If we try this:
Generex generex = new Generex("(.{1,6})( *, *(.{1,6})){0,5}");
System.out.println(generex.random());
it takes about 1 second to finish. But, if we try this RegEx:
Generex generex = new Generex("(.{1,6})( *, *(.{1,6})){0,12}");
System.out.println(generex.random());
it takes about 40 seconds.
Finally, the code
Generex generex = new Generex("(.{1,6})( *, *(.{1,6})){0,15}");
System.out.println(generex.random());
took a whopping 3 minutes and generated one character as a result.
Now I'm perfectly aware that users can write all sorts of RegExps. It's probably impossible to make code which efficiently generates them all. Yet I hope there's a possibility that for some cases generation might be faster.
ghilainm
Metadata
Metadata
Assignees
Labels
No labels