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

provider a json encoder to the tree structure #29

Closed c9s closed 10 years ago

thedrow commented 10 years ago

I strongly suggest to use https://github.com/esnme/ujson4c/. It's blazingly fast,

c9s commented 10 years ago

Well, I actually don't want to add more dependencies. we might just want a simpler encoder (using vasprintf + strncat) since our data structures are fixed fields and they are pretty simple.

and the JSON encoder can be done < 100 lines I think.

c9s commented 10 years ago

Hi @thedrow,

I looked into the source code of ujson4c. not sure if the license will conflict with our MIT license?

c9s commented 10 years ago

Just found that json-c/json-c is using MIT license

thedrow commented 10 years ago

We can open an issue at their end but I believe that BSD3 with MIT is fine as long as you attribute them for the contribution.

c9s commented 10 years ago

double checked... there are only decoding functions in ujson4c

c9s commented 10 years ago

looks like i will pick json-c instead of this. it's also in MIT license.

c9s commented 10 years ago

built json:

https://gist.github.com/c9s/bb5e5f4a3defd57099e0

thedrow commented 10 years ago

No encoders? :( json-c it is.

c9s commented 10 years ago

Done. just got merged into master.