<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>Kevin, you would need such lookups only once when the file path is encountered for the first time. Then it can be stored in a hash table inside rrdcached.</span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 13.3333px; font-family: arial,helvetica,sans-serif; background-color: transparent; font-style: normal;"><span><br></span></div><div><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2">
<hr size="1"> <b><span style="font-weight:bold;">From:</span></b> kevin brintnall <kbrint@rufus.net><br> <b><span style="font-weight: bold;">To:</span></b> Kiss Gabor (Bitman) <kissg@ssg.ki.iif.hu> <br><b><span style="font-weight: bold;">Cc:</span></b> "rrd-developers@lists.oetiker.ch" <rrd-developers@lists.oetiker.ch> <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, December 5, 2012 11:18 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [rrd-developers] rrdcached: path sanitizer<br> </font> </div> <br>
<meta http-equiv="x-dns-prefetch-control" content="off"><div id="yiv996996145"><div class="yiv996996145gmail_extra">On Wed, Dec 5, 2012 at 8:58 AM, Kiss Gabor (Bitman) <span dir="ltr"><<a rel="nofollow" ymailto="mailto:kissg@ssg.ki.iif.hu" target="_blank" href="mailto:kissg@ssg.ki.iif.hu">kissg@ssg.ki.iif.hu</a>></span> wrote:<br><div class="yiv996996145gmail_quote"><blockquote class="yiv996996145gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>DESCRIPTION<br>
realpath() expands all symbolic links and resolves references to /./,<br>
/../ and extra '/' characters in the null-terminated string named by<br>
path to produce a canonicalized absolute pathname. The resulting path-<br>
name is stored as a null-terminated string, up to a maximum of PATH_MAX<br>
bytes, in the buffer pointed to by resolved_path. The resulting path<br>
will have no symbolic link, /./ or /../ components.<br></div></blockquote></div><br>This is going to cause a LOT of stat() calls: O(commands * average dir depth)</div><div class="yiv996996145gmail_extra"><br></div><div class="yiv996996145gmail_extra">
I see your point, but it's probably better to do trivial string manipulations that don't hit the filesystem.</div><div class="yiv996996145gmail_extra">The whole point of rrdcached is to defer and collate I/O.<br></div><div class="yiv996996145gmail_extra">
<br></div><div class="yiv996996145gmail_extra">If you feel strongly about it, I encourage you to benchmark it with a non-trivial number of files (500,000) and command rate (1k/sec).</div><br> </div><br></div> </div> </blockquote></div> </div></body></html>