Tomas [ARCHIVE] on Nostr: 📅 Original date posted:2017-04-07 📝 Original message:Hi Eric, On Fri, Apr 7, ...
📅 Original date posted:2017-04-07
📝 Original message:Hi Eric,
On Fri, Apr 7, 2017, at 21:55, Eric Voskuil via bitcoin-dev wrote:
> Optimization for lower memory platforms then becomes a process of
> reducing the need for paging. This is the purpose of a cache. The seam
> between disk and memory can be filled quite nicely by a small amount
> of cache. On high RAM systems any cache is actually a de-optimization
> but on low RAM systems it can prevent excessive paging. This is
> directly analogous to a CPU cache.
I am not entirely sure I agree with that, or understand it correctly.
If -for example - the data of some application is a set of records
which can be sorted from least frequently used to most frequently used
then doing just that sort will beat any application-layer cache.
Regardless of size of data and size of RAM, you simply allow the OS to
use disk caching or memory map caching to work its magic .
In fact, I would argue that an application-layer cache *only* makes
sense if the data model shows a *hard* distinction between often and not
often used data. If usage-frequency is a continuous line, caching is
best left to the OS by focussing on proper spatial and temporal locality
of reference of your data, because the OS has much more information to
make the right decision.
Published at
2023-06-07 17:59:39Event JSON
{
"id": "c5edef772f1e61c7cfe3c5de4e5e197bb7d9e93ef58ba90ba4997d1ccfde9805",
"pubkey": "1c03575343555d1132a621c49466190d680da4a306ba8b992e8b87e267609cdd",
"created_at": 1686160779,
"kind": 1,
"tags": [
[
"e",
"d4a682be1f6603f0ff8798c52b7225cac6554e21f3aedb0c80e7d41cf71983ad",
"",
"root"
],
[
"e",
"8ed593a63514a23a3acca276857ff7f21246544b9fd4538b772ba97d49afe353",
"",
"reply"
],
[
"p",
"82205f272f995d9be742779a3c19a2ae08522ca14824c3a3b01525fb5459161e"
]
],
"content": "📅 Original date posted:2017-04-07\n📝 Original message:Hi Eric,\n\nOn Fri, Apr 7, 2017, at 21:55, Eric Voskuil via bitcoin-dev wrote:\n\u003e Optimization for lower memory platforms then becomes a process of\n\u003e reducing the need for paging. This is the purpose of a cache. The seam\n\u003e between disk and memory can be filled quite nicely by a small amount\n\u003e of cache. On high RAM systems any cache is actually a de-optimization\n\u003e but on low RAM systems it can prevent excessive paging. This is\n\u003e directly analogous to a CPU cache. \n\n\nI am not entirely sure I agree with that, or understand it correctly.\n\nIf -for example - the data of some application is a set of records\nwhich can be sorted from least frequently used to most frequently used\nthen doing just that sort will beat any application-layer cache.\nRegardless of size of data and size of RAM, you simply allow the OS to\nuse disk caching or memory map caching to work its magic .\n\nIn fact, I would argue that an application-layer cache *only* makes\nsense if the data model shows a *hard* distinction between often and not\noften used data. If usage-frequency is a continuous line, caching is\nbest left to the OS by focussing on proper spatial and temporal locality\nof reference of your data, because the OS has much more information to\nmake the right decision.",
"sig": "7befe32904b143ee4038c46942655c3ebe1c59281029042a8c83519f8168d158fcb0c77d843b9841695a0c40bf14dbd5d29c56d10c18e01fe0847bef1e3a3ffa"
}