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

Move certain fs/utils to c++ #111

Open
anonrig opened this issue Sep 11, 2023 · 8 comments
Open

Move certain fs/utils to c++ #111

anonrig opened this issue Sep 11, 2023 · 8 comments

Comments

@anonrig
Copy link
Member

anonrig commented Sep 11, 2023

All filesystem operations has the following functions, that could improve the performance if moved to C++:

  • getValidatedPath
  • getValidMode
  • path.toNamespacedPath
@tony-go
Copy link
Member

tony-go commented Sep 11, 2023

Interesting one :)

@H4ad
Copy link
Member

H4ad commented Sep 11, 2023

toNamespacedPath already has a C++ port: https://github.com/nodejs/node/blob/main/src/node_file.cc#L844-L855

For this one, we just need to expose.

@anonrig
Copy link
Member Author

anonrig commented Sep 11, 2023

@H4ad we need to call C++ function from all functions in node_file.cc and remove the call from javascript side (lib/fs.js).

@tony-go
Copy link
Member

tony-go commented Sep 11, 2023

For getValidatedPath, it seems that pathModule.toNamespacedPath is often called after it, maybe we should move both?

@andremralves
Copy link

path.toNamespacedPath makes a call to another function win32.resolve(), is there an equivalent of this function in the c++ land or should we move it too?

@anonrig
Copy link
Member Author

anonrig commented Oct 6, 2023

path.toNamespacedPath makes a call to another function win32.resolve(), is there an equivalent of this function in the c++ land or should we move it too?

I don't think so

@Uzlopak
Copy link
Contributor

Uzlopak commented Oct 7, 2023

Just want to say, that by moving validators to c++ could mean that the Errors could contain them in the stacktrace. Thats why we have currently hideStackframes functions, because there is no inline specifier in javascript. Maybe you also have to inline the validators in c++, to avoid the stacktraces to not contain the validators.

@RafaelGSS
Copy link
Member

path.toNamespacedPath makes a call to another function win32.resolve(), is there an equivalent of this function in the c++ land or should we move it too?

Actually, I and @Ceres6 are working on that. We're porting path.resolve() to the C++ side to use in the permission model.

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

6 participants