From 88d485882aa3aea1f028f4ee19f4c0fe28415d52 Mon Sep 17 00:00:00 2001 From: c9s Date: Fri, 16 May 2014 19:18:47 +0800 Subject: [PATCH] Description route data --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index e6033a3..768b45b 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,20 @@ r3 uses the same route path data for benchmarking, and here is the benchmark: The matching speed of r3 is 527+ times faster than rails' trie router. +### Route Paths + +The route path generator is from : + +```ruby +#!/usr/bin/env ruby +arr = ["foo", "bar", "baz", "qux", "quux", "corge", "grault", "garply"] +paths = arr.permutation(3).map { |a| "/#{a.join '/'}" } +paths.each do |path| + puts "r3_tree_insert_path(n, \"#{path}\", NULL);" +end +``` + + Use case in PHP -----------------------