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

Serialization / deserialization speed optimizations #357

Open
KeithVinson opened this issue May 18, 2023 · 2 comments
Open

Serialization / deserialization speed optimizations #357

KeithVinson opened this issue May 18, 2023 · 2 comments

Comments

@KeithVinson
Copy link

Hello All,
I am wondering how best to control Message Pack to maximize the speed at which large objects can be read / written to disk. In my specific case the files on disk are approaching 10 GB in size. They contain fairly large Sorted Dictionaries. When I load them into memory the process can take upwards of 6-8 minutes to load. This process is running on a very beefy server with dual CPU totaling 32 cores and having 256 GB of memory. When reading the disk I can see periods of up to 750 MB / second transfer speeds, but there are periods where no disk transfers are occurring even though the load process has not completed. I am wonder if their are some options I should select for the MessagePack Serializer that could improve my performance. When accessing the disks (NVMe in a RAID 5 array) I see a very curious "ringdown" pattern on disk transfers as the load process proceeds. Any help you might suggest would be welcome.

Here is a sample of the code used to load the Dictionaries:
public static T ReadMsgPkFile<T> (string filePath) { using (Stream stream = File.Open (filePath, FileMode.Open, FileAccess.Read, FileShare.Read)) { return (T)MessagePackSerializer.Deserialize<T> (stream); } }
RemoteDesktopManager_jXRwtTRJgc

@yfakariya
Copy link
Member

MessagePack for CLI simply uses System.IO.Stream, so you might improve performance of I/O. For example, you can adjust buffer size of your FileStream with its constructor parameter to be the write more chunky.

@KeithVinson
Copy link
Author

KeithVinson commented May 21, 2023 via email

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