Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized XOR is 14% slower than unoptimized XOR on Apple Silicon #176

Open
tjgreen42 opened this issue Nov 25, 2024 · 0 comments
Open

Optimized XOR is 14% slower than unoptimized XOR on Apple Silicon #176

tjgreen42 opened this issue Nov 25, 2024 · 0 comments

Comments

@tjgreen42
Copy link
Contributor

What happened?

On my Macbook Pro cargo bench shows optimized XOR running about 14% slower than unoptimized XOR:

Distance xor/xor unoptimized u64
                        time:   [3.7793 ns 3.7834 ns 3.7899 ns]

Distance xor/xor optimized version we use in code
                        time:   [4.3114 ns 4.3156 ns 4.3244 ns]

The same experiment on an x86 cloud desktop shows a speedup of around 3x:

Distance xor/xor unoptimized u64
                        time:   [25.285 ns 25.497 ns 25.713 ns]
Distance xor/xor optimized version we use in code
                        time:   [8.8554 ns 8.9635 ns 9.0748 ns

pgvectorscale extension affected

0.5.1

PostgreSQL version used

17

What operating system did you use?

MacOS 15.1.1 / Debian 12

What installation method did you use?

Source

What platform did you run on?

Amazon Web Services (AWS)

Relevant log output and stack trace

No response

How can we reproduce the bug?

cargo bench

Are you going to work on the bugfix?

None

@tjgreen42 tjgreen42 added bug Something isn't working good first issue Good for newcomers pgvectorscale community and removed bug Something isn't working labels Nov 25, 2024
@tjgreen42 tjgreen42 changed the title <Title> optimized XOR is 14% slower than unoptimized XOR on Apple Silicon Optimized XOR is 14% slower than unoptimized XOR on Apple Silicon Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant