jovibor / HexCtrl

Fully-featured Hex Control written in C++/MFC.
Other
164 stars 61 forks source link

Data fill performance #60

Closed jovibor closed 2 years ago

jovibor commented 2 years ago

Discussed in https://github.com/jovibor/HexCtrl/discussions/58

Originally posted by **datasynergyuk** October 23, 2021 I have done some performance testing on the release build of the sample application. All testing was done on the same hardware (i7, 32GB RAM, SSD) using an 8GB test file. Each test was done with a fresh application launch to avoid caching effects. I think there may be some opportunity to improver performance further: 1. Fill zero - 2,200MB/sec 2. Fill with hex data 64 bytes at a time (e.g. 128 zeros) - >4,200MB/sec. This operation is essentially the same as the standard fill with zero feature but, by using the fill with data mode and supplying a buffer of 64 bytes, the performance is 2x. I would suggest the fill zero feature should be able to achieve something similar to the fill data feature using a string of "0000000...000". 3. Fill random - 380MB/sec. This is a big improvement on the previous performance. 4. Fill with 'random' hex data (e.g. 128 characters) - As above, this can achieve >4,200MB/sec. Please can I suggest an additional "fast but less random" fill mode that uses a repeating buffer of perhaps 4KB random data. This would be adequate for many cases and would have performance approx. > 10x the current "fill very random" feature. e.g. In this mode, the random data would only be generated once and then recycled every 4KB. This would be suitable for fast data sanitation tasks.