View previous topic :: View next topic |
Author |
Message |
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Wed Sep 14, 2005 2:21 am Post subject: In cache/, what does %%39 39 3990E2F5%% mean? |
|
|
In my cache dir, I have a file:
cache/cacheid/groupid/compileid/%%39/399/3990E2F5%%page.html
Do the "%%39", "399", and "3990E2F5" mean anything? Why are those extra dirs even necessary? There's never more than one dir/file in each. Also, why are %%'s used? |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Sep 14, 2005 8:03 am Post subject: Re: In cache/, what does %%39 39 3990E2F5%% mean? |
|
|
gerard wrote: | There's never more than one dir/file in each. |
wrong. if you have more than 16^3 (4096) compiled templates with the same compile_id you'll have at least one of the directories containing more than one file.
Quote: | Also, why are %%'s used? |
%% is the seperator between the compile_id and the autogenerated filename. |
|
Back to top |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Wed Sep 14, 2005 8:11 am Post subject: |
|
|
That seems like pretty long odds that there will be more than one file in a directory. I think smarty should make better use of cache sub_dirs - break them up into buckets or something. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Sep 14, 2005 8:31 am Post subject: |
|
|
gerard wrote: | That seems like pretty long odds that there will be more than one file in a directory. I think smarty should make better use of cache sub_dirs - break them up into buckets or something. |
give code, give numbers and give a proof that your solution is considerably better than the current one.
become concrete instead of making superficial assumptions.
thanks. |
|
Back to top |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Wed Sep 14, 2005 9:25 am Post subject: |
|
|
Uh, do you have numbers and proof? Concrete and non-superficial? Let's see it. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Sep 14, 2005 3:17 pm Post subject: |
|
|
@gerard: I think messju is saying that if you think you have a good idea to improve the mechanism, write a patch and submit it with benchmarks showing why it is better. Otherwise you'll find that the people who actually implemented the routine are already satisfied with its behaviour and don't feel the need to prove why it is better than a hypothetical design. That doesn't mean it can't be better than it is, but it does mean that if someone wants to improve it with a patch, the onus is on them to show that their patch is actually an improvement. |
|
Back to top |
|
gerard Smarty Regular
Joined: 18 Apr 2003 Posts: 84
|
Posted: Sat Sep 17, 2005 12:24 am Post subject: |
|
|
I figured a way to avoid the 32000 directory entry limit problem:
$cache_key="item|".implode('|', str_split((int)$_GET['id'], 4)); |
|
Back to top |
|
|