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

Shower Than C Extension #149

Open
arshidkv12 opened this issue Jan 24, 2024 · 6 comments
Open

Shower Than C Extension #149

arshidkv12 opened this issue Jan 24, 2024 · 6 comments

Comments

@arshidkv12
Copy link

Hi
I tested with xdebug profile option with grind cache.
Functions are slower than c. How to speed up?

@jmjoy
Copy link
Member

jmjoy commented Jan 25, 2024

What about the data?

@arshidkv12
Copy link
Author

arshidkv12 commented Jan 25, 2024

cachegrind

PHP code:

for ($i=0; $i < 1000; $i++) { 
        say_hello("sdf"); //rust
        strpos("sdfsf", "d", 1); //c function
}

Rust:

pub fn say_hello(arguments: &mut [ZVal]) -> phper::Result<()> {

    Ok(())
}

@jmjoy
Copy link
Member

jmjoy commented Jan 25, 2024

Do you build under release?

@arshidkv12
Copy link
Author

arshidkv12 commented Jan 25, 2024 via email

@jmjoy
Copy link
Member

jmjoy commented Jan 25, 2024

image

@arshidkv12
Copy link
Author

image

0.18 > 0.11

Why does the Rust function take longer than the C complex O(n) function?

How to optimise it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants