c9s / r3

libr3 is a high-performance path dispatching library. It compiles your route paths into a prefix tree (trie). By using the constructed prefix trie in the start-up time, you may dispatch your routes with efficiency
http://c9s.github.com/r3/bench.html
MIT License
814 stars 83 forks source link

Added the r3_dump_str function #39

Closed thedrow closed 8 years ago

thedrow commented 10 years ago

I'm going to keep this branch maintained as I'll migrate methods from char * to sds. I know you asked me to avoid doing so on certain methods so I'll migrate them one by one so you can cherry pick according to the benchmarks. Who knows? It might be faster.

Review on Reviewable

c9s commented 10 years ago

You may run tests/benchmark and compare the benchmark result with the result of the master branch.

c9s commented 10 years ago

http://c9s.github.io/r3/bench.html Here is the benchmark tracking graph, you should check the graph frequently while developing. it's helpful.

thedrow commented 10 years ago

What do you think about the current change?

thedrow commented 10 years ago

Because it's recursive. We can have an internal function to handle that though.

c9s commented 10 years ago

you can have a r3_tree_dump_sds function that takes the sds struct. so r3_tree_dump_str calls r3_tree_dump_sds to generate the result recursively.

c9s commented 10 years ago

I still think it's OK for dumping struct through sds (string operation outside of critical area). I don't want to replace the current dispatching functions with sds.

c9s commented 10 years ago

Hi @thedrow , Is char * text = r3_tree_dump_str(n, 0); ready to dump? :-)

thedrow commented 10 years ago

Sorry, I had a lot on my plate lately. I will get to it soon.

c9s commented 10 years ago

oh, you can take your time, it's not in a hurry. just worry about the code conflicts.

c9s commented 8 years ago

Closed since there are too many changes in 2.0 branch.