Closed peterberbec closed 8 years ago
OH .. sorry for the confusion, I meant we stopped using YURLS itself cause we were hitting the piss nuts out of it! sorry about that .. your stuff looks tight!
OHH! Sorry. I thought I had coded something and blown up your server! Phew!!!!
Closing.
Resolution: @peterberbec is paranoid.
per http://berb.ec/m8nbq
Is there some part of my code that is particularly DB intensive?
As I read it, all the plugin does is pass a pre-set length, the option '0' to enforce limited charset, and the limited charset into yourls_rnd_string(), forcing it into the 1st option of this case statement:
http://berb.ec/67ade
From what I see, the case statement resolves to an assignment statement, no matter what option is given. The one we go through has a
?:
test, but that is at worst one additional in-memory comparison. The extra database access could be occurring because$link_length
and$charset_liste
need to be read every link creation. This may cause two extra reads DB per link creation.Is it possible, necessary and/or a good idea to force
$link_length
and$charset_liste
to remain in RAM? This would remove two potential DB hits per link.Comments, suggestions?