Initial Go support#153
Conversation
|
Wow, I am surprised the latency is comparable. How long is the input? I believe for Go, it would be great to transpile our C code. |
|
I'll look at transpiling. I don't expect there to be a significant improvement on these benchmarks - its probably likely to slow things down considerably from what I've read. The strings are 1mb. Below are 10kb strings. Short strings show the same performance except for IndexAny where the go time eventually matches stringzilla. |
|
How about super short inputs in the range of 10-100 bytes? |
|
None of the transpilers work on the stringzilla code. I don't see much information on them. Build flags are the following by the way. -O3 slows us down. 100b 16b |
|
Others benchmarking cgo state its 40ns per C call, but I don't see it being that slow. I'll get more of the funcs in as I'm using this in some of my go projects. We can also try manually writing a func or two in go to see how that goes. |
|
@ashvardanian A) Write Count in C so its one function call to C instead of N calls Let me know and I'll go ahead. The below numbers are for a 9 byte substring to match - strings.Count is faster if the substring to search for is 4 bytes or less. |
|
How about we implement the count in the cGo header? |
430f05e to
f7e4c05
Compare
19e6998 to
4e33434
Compare
e0a9e4e to
c8c6c7c
Compare
### Minor - Add: GoLang support (#153) (1c99ff4) ### Patch - Improve: Extended GoLang benchmarks (4fbdd0b) - Improve: New GoLang testing suite (7085d92) - Make: Define the GoLang module (3949cf5) - Improve: GoLang 1.24 directives (25c3b5c) - Make: Remove confusing `build.sh` (7bbb371) - Docs: Counting `.h` as C code lines (310f8c9)
Added a few functions for go. If we merge this I'll finish it up.