Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

In cache/, what does %%39 39 3990E2F5%% mean?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Wed Sep 14, 2005 2:21 am    Post subject: In cache/, what does %%39 39 3990E2F5%% mean? Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Sep 14, 2005 8:03 am    Post subject: Re: In cache/, what does %%39 39 3990E2F5%% mean? Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Wed Sep 14, 2005 8:11 am    Post subject: Reply with quote

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
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Wed Sep 14, 2005 8:31 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Wed Sep 14, 2005 9:25 am    Post subject: Reply with quote

Uh, do you have numbers and proof? Concrete and non-superficial? Let's see it.
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Wed Sep 14, 2005 3:17 pm    Post subject: Reply with quote

@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
View user's profile Send private message
gerard
Smarty Regular


Joined: 18 Apr 2003
Posts: 84

PostPosted: Sat Sep 17, 2005 12:24 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP