
org.joni.bench.BenchRailsRegs Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of joni Show documentation
Show all versions of joni Show documentation
Java port of Oniguruma: http://www.geocities.jp/kosako3/oniguruma
that uses byte arrays directly instead of java Strings and chars
The newest version!
package org.joni.bench;
public class BenchRailsRegs extends AbstractBench {
public static void main(String[] args) throws Exception {
final String[][] regexps = {{"a.*?[b-z]{2,4}aaaaaa","afdgdsgderaabxxaaaaaaaaaaaaaaaaaaaaaaaa"},
{"://","/shop/viewCategory.shtml?category=DOGS"},
{"^\\w+\\://[^/]+(/.*|$)$","/shop/viewCategory.shtml?category=DOGS"},
{"\\A/?\\Z","/shop/viewCategory.shtml"},
{"\\A/shop/signonForm\\.shtml/?\\Z","/shop/viewCategory.shtml"},
{"\\A/shop/newAccountForm\\.shtml/?\\Z","/shop/viewCategory.shtml"},
{"\\A/shop/newAccount\\.shtml/?\\Z","/shop/viewCategory.shtml"},
{"\\A/shop/viewCart\\.shtml/?\\Z","/shop/viewCategory.shtml"},
{"\\A/shop/index\\.shtml/?\\Z","/shop/viewCategory.shtml"},
{"\\A/shop/viewCategory\\.shtml/?\\Z","/shop/viewCategory.shtml"},
{"\\A(?:::)?([A-Z]\\w*(?:::[A-Z]\\w*)*)\\z","CategoriesController"},
{"\\Ainsert","SELECT * FROM sessions WHERE (session_id = '1b341ffe23b5298676d535fcabd3d0d7') LIMIT 1"},
{"\\A\\(?\\s*(select|show)","SELECT * FROM sessions WHERE (session_id = '1b341ffe23b5298676d535fcabd3d0d7') LIMIT 1"},
{".*?\n","1b341ffe23b5298676d535fcabd3d0d7"},
{"^find_(all_by|by)_([_a-zA-Z]\\w*)$","find_by_string_id"},
{"\\.rjs$","categories/show.rhtml"},
{"^[-a-z]+://","petstore.css"},
{"^get$",""},
{"^post$",""},
{"^[^:]+","www.example.com"},
{"(=|\\?|_before_type_cast)$", "updated_on"},
{"^(.*?)=(.*?);","_petstore_session_id=1b341ffe23b5298676d535fcabd3d0d7; path=/"}};
for(String[] reg : regexps) {
new BenchRailsRegs().benchBestOf(reg[0],reg[1],10,1000000);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy