Skip to content

v1.0.0

Latest
Compare
Choose a tag to compare
@wuputah wuputah released this 25 Jan 20:18
· 12 commits to main since this release
7dd46a8

1.0.0

Initial release.

pg_stringtheory is a CPU-specific optimization for string comparison operators using SSE4.2 on x86_64 platforms, and SWAR64 on aarch64 and arm64 platforms. It implements two functions:

  • stringtheory.equals(a TEXT, b TEXT) - returns BOOLEAN, true if there is an exact match, and false if there is not.

  • stringtheory.strstr(haystack TEXT, needle TEXT) - returns INTEGER, the position of where the needle is found in the haystack, or -1 if it is not found.

Note that this extension will not run on all CPUs and architectures. In the future, CPU features may be detected (e.g. using google/cpu_features), but this is not currently implemented.