-
Notifications
You must be signed in to change notification settings - Fork 63
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
Optimize full mode #64
Comments
Full mode encryption does more things and that is the major reason it is slower. Per the past profiling, the bottleneck is on HMAC computation and syscalls to access the meta file. It is not possible to improve as HMAC speed is determined by Crypto++ and syscall speed is determined by the OS. Once upon a time, |
Okay, it's good to hear that it's been profiled. I wonder if there's some performance to be gained with some sort of in-memory caching of the B-trees or deferring high-latency tasks to background worker threads so you can have better overall throughput. I'll read through Do you have any standard workloads or profiling techniques? If I start tweaking things I'd like to keep consistent with the performance measures you're already using. |
If I'm reading securefs/sources/operations.cpp Line 62 in bb3cc57
|
I ran an experiment and this kind of caching seems to have negligible effect. However, it seems that a lot of time gets spent "evicting" closed files from the cache. I'm looking at what kinds of things take so much time when freeing a |
Did you profile the program and find the time spent evicting closed files? |
I ran
I'm using a USB3 flash drive, if that changes anything about the performance expectations. |
When you I thought about your design before, but did not choose it, because I was not confident that the filesystem could remain intact when I did not think thoroughly though. If you think it is possible to maintain filesystem integrity even when it crashes, then I might implement the caching or accept your PR. |
Wait a minute. I forget all the design rationales for the full mode. I need to think carefully. |
Those runs of The concern I'd have with this in-memory cache is that if something other than |
(the encrypted files getting modified is plausible in a situation where the cyphertext is synchronized via a cloud service while the FS is mounted locally) |
Send me your modified version as a pull request, even if it is just a draft. It is hard to discuss without a concrete implementation. |
Is it possible to multithread "full" mode encryption? As it is, full mode seems much slower than it should be, and I think this is because it is forced to run in single-threaded mode.
I might be able to help with this (I have some experience writing safe parallel data structures using fine-grained-locking), but if there are known limitations or correctness concerns I'd like to know about those before I start experimenting.
The text was updated successfully, but these errors were encountered: