Fork me on GitHub
Reply New Topic
2010/9/23 12:12:35
#1
Offline
Home away from home

Imlinks performance

Imlinks is a excelent module; a flagship.
But It seems has problems on performance; according to debug, take lot of time to load. My page has 6 categories and 65 links.
Is it right?


2010/9/23 13:02:47
#2
Offline
Home away from home

Re: Imlinks performance

imLinks and modules based on this like MyTuve and Impression are slow indeed. Not sure what's causing this. The only thing I know that with the original WF-Links this was also the case.

On my website I have 192 Categories and 2547 Links. For this I have enabled GZip compression in the General Preferences of ICMS and set the cache of imLinks to 30 minutes.


Edited by UnderDog on 2010/9/24 2:01:05
_________________
McDonalds Store

2010/9/23 14:44:34
#3
Offline
Home away from home

Re: Imlinks performance

I had using 1.02 release; just updating five minutes ago to 1.04 RC1 and performance is really better. Run fast now. Thanks!! :)

Nice URL feature is fine; however, special characters got problem. In Spanish are letters as ñ, or ó, é, etc (I suppose in French or German too)
Example: asociación become asociacin
I know the news module by Underdog has a replace function; I do not know if it is useful for you.


2010/9/23 15:27:45
#4
Offline
Home away from home

Re: Imlinks performance

Quote:

debianus wrote:
Nice URL feature is fine; however, special characters got problem. In Spanish are letters as ñ, or ó, é, etc (I suppose in French or German too)
Example: asociación become asociacin
I know the news module by Underdog has a replace function; I do not know if it is useful for you.


You can enter a nice url manually in the submit form (admin) to avoid these special characters being stripped out. I use this option myself often.

The reason these special characters are removed is that the nice url feature uses filter_var with the FILTER_SANITIZE_SPECIAL_CHARS filter. See functions.php. This filter allows ASCII only.
At the moment it also allows symbols in the url what I don't like.
I think I will make some kind of extra filter so these characters and symbols are replaced automatically.

_________________
McDonalds Store

2010/9/23 17:33:51
#5
Offline
Home away from home

Re: Imlinks performance

Have you tried FILTER_SANITIZE_URL? There is also another flag you can use with FILTER_SANITIZE_SPECIAL_CHARS - FILTER_FLAG_ENCODE_HIGH

_________________

Steve Twitter: @skenow Facebook: Steve Kenow


2010/9/24 0:51:07
#6
Offline
Home away from home

Re: Imlinks performance

for future reference with icms 1.3 or newer.

checkout the function checkVar($var, $type, $opt1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xzZScgPSBEbyBOb3QgdXNlIEVtYWlsIEJsYWNrbGlzdA0KCSoJCQkJSVA6DQoJKgkJCQkJTk9UIFVTRUQhDQoJKgkJCQlJTlQ6DQoJKgkJCQkJbWF4aW11bSBpbnRlZ2VyIHJhbmdlIHZhbHVlDQoJKg0KCSogQHJldHVybgltaXhlZA0KCSovDQo=

_________________
Live as if you were to die tomorrow, Learn as if you were to live forever

The beauty of a living thing is not the atoms that go into it, but the way those atoms are put together!

2010/9/24 2:15:37
#7
Offline
Home away from home

Re: Imlinks performance

The special characters as mentioned by debianus are not allowed in an URL.

imLinks uses 2 filters as follows:
ZnVuY3Rpb24gaW1sX25pY2VsaW5rKCAkdGl0bGUsICRuaWNldXJsICkgew0KCSR0aXRsZSA9IHN0cnRvbG93ZXIoIGZpbHRlcl92YXIoIHN0cl9yZXBsYWNlKCAnICcsICdfJywgJHRpdGxlICksIEZJTFRFUl9TQU5JVElaRV9TUEVDSUFMX0NIQVJTICkgKTsNCgkkbmljZXVybCA9IHN0cnRvbG93ZXIoIGZpbHRlcl92YXIoIHN0cl9yZXBsYWNlKCAnICcsICdfJywgJG5pY2V1cmwgKSwgRklMVEVSX1NBTklUSVpFX1NQRUNJQUxfQ0hBUlMgKSApOw0KCWlmICggISRuaWNldXJsICkgew0KCQkkbmljZWxpbmsgPSBmaWx0ZXJfdmFyKCAkdGl0bGUsIEZJTFRFUl9TQU5JVElaRV9VUkwgKTsNCgl9IGVsc2Ugew0KCQkkbmljZWxpbmsgPSBmaWx0ZXJfdmFyKCAkbmljZXVybCwgRklMVEVSX1NBTklUSVpFX1VSTCApOw0KCX0NCglyZXR1cm4gJG5pY2VsaW5rOw0KfQ==
The FILTER_SANITIZE_URL filter removes all illegal URL characters from a string.

This filter allows all letters, digits and $-_.+!*'(),{}|\\^~[]`"><#%;/?:@&=

See here for example.

But, if you like to have the special characters in the URL than modify the function as follows:
ZnVuY3Rpb24gaW1sX25pY2VsaW5rKCAkdGl0bGUsICRuaWNldXJsICkgew0KLy8JJHRpdGxlID0gc3RydG9sb3dlciggZmlsdGVyX3Zhciggc3RyX3JlcGxhY2UoICcgJywgJ18nLCAkdGl0bGUgKSwgRklMVEVSX1NBTklUSVpFX1NQRUNJQUxfQ0hBUlMgKSApOw0KLy8JJG5pY2V1cmwgPSBzdHJ0b2xvd2VyKCBmaWx0ZXJfdmFyKCBzdHJfcmVwbGFjZSggJyAnLCAnXycsICRuaWNldXJsICksIEZJTFRFUl9TQU5JVElaRV9TUEVDSUFMX0NIQVJTICkgKTsNCglpZiAoICEkbmljZXVybCApIHsNCgkJJG5pY2VsaW5rID0gJHRpdGxlOyAvLyBmaWx0ZXJfdmFyKCAkdGl0bGUsIEZJTFRFUl9TQU5JVElaRV9VUkwgKTsNCgl9IGVsc2Ugew0KCQkkbmljZWxpbmsgPSAkbmljZXVybDsgLy8gZmlsdGVyX3ZhciggJG5pY2V1cmwsIEZJTFRFUl9TQU5JVElaRV9VUkwgKTsNCgl9DQoJcmV0dXJuICRuaWNlbGluazsNCn0=

_________________
McDonalds Store

2010/9/24 8:51:34
#8
Offline
Home away from home

Re: Imlinks performance

Of course, about new entries in imLinks and Impression there are the possibility for post one right title. The problems is about old entries.
Now special characters are deleted; however better would be change them.
ó become o, etc.
Example from news 1.70 (include/functions.php)
ZnVuY3Rpb24gZWxpbWluYV9hY2VudG9zDQooJHN0cmluZywgJGVuYyA9ICdVVEYtOCcpIHsgJGFjZW50b3MgPSBhcnJheSggJ0EnID0+ICcvJkFncmF2ZTt8JkFhY3V0ZTt8JkFjaXJjO3wmQXRpbGRlO3wmQXVtbDt8JkFyaW5nOy8nLCAJJ2EnID0+ICcvJmFncmF2ZTt8JmFhY3V0ZTt8JmFjaXJjO3wmYXRpbGRlO3wmYXVtbDt8JmFyaW5nOy8nLCAJJ0MnID0+ICcvJkNjZWRpbDsvJywgCSdjJyA9PiAnLyZjY2VkaWw7LycsIAknRScgPT4gJy8mRWdyYXZlO3wmRWFjdXRlO3wmRWNpcmM7fCZFdW1sOy8nLCAJJ2UnID0+ICcvJmVncmF2ZTt8JmVhY3V0ZTt8JmVjaXJjO3wmZXVtbDsvJywgCSdJJyA9PiAnLyZJZ3JhdmU7fCZJYWN1dGU7fCZJY2lyYzt8Jkl1bWw7LycsIAknaScgPT4gJy8maWdyYXZlO3wmaWFjdXRlO3wmaWNpcmM7fCZpdW1sOy8nLCAJJ04nID0+ICcvJk50aWxkZTsvJywgCSduJyA9PiAnLyZudGlsZGU7LycsIAknTycgPT4gJy8mT2dyYXZlO3wmT2FjdXRlO3wmT2NpcmM7fCZPdGlsZGU7fCZPdW1sOy8nLCAJJ28nID0+ICcvJm9ncmF2ZTt8Jm9hY3V0ZTt8Jm9jaXJjO3wmb3RpbGRlO3wmb3VtbDsvJywgCSdVJyA9PiAnLyZVZ3JhdmU7fCZVYWN1dGU7fCZVY2lyYzt8JlV1bWw7LycsIAkndScgPT4gJy8mdWdyYXZlO3wmdWFjdXRlO3wmdWNpcmM7fCZ1dW1sOy8nLCAJJ1knID0+ICcvJllhY3V0ZTsvJywgCSd5JyA9PiAnLyZ5YWN1dGU7fCZ5dW1sOy8nLCAJJ2EuJyA9PiAnLyZvcmRmOy8nLCAJJ28uJyA9PiAnLyZvcmRtOy8nICk7ICAkc3RyaW5nID0gZXJlZ19yZXBsYWNlKCIgIiwgIi0iLCBwcmVnX3JlcGxhY2UoIi9bXVs+PH17KSg6OywhPyolfl5gJ+KAmSYjQF0vIiwgIiIsICRzdHJpbmcpKTsgIHJldHVybiBzdHJ0b2xvd2VyKHByZWdfcmVwbGFjZSgkYWNlbnRvcywgYXJyYXlfa2V5cygkYWNlbnRvcyksIGh0bWxlbnRpdGllcygkc3RyaW5nLCBFTlRfTk9RVU9URVMsICRlbmMpKSkuJy5odG1sJzsgfSA=


2010/9/24 9:55:16
#9
Offline
Home away from home

Re: Imlinks performance

My opinion is that we somehow should make a core function for this. All modules run into this problem.
News has its own function, ImLinks has its own function. We can better make 1 good function and implement it in both modules?


2010/9/25 12:43:07
#10
Offline
Home away from home

Re: Imlinks performance

@debianus,

I've made an additional 'filter' that will turn the special characters in 'normal' characters.

In function.php find the function iml_nicelink and replace it with this one:
ZnVuY3Rpb24gaW1sX25pY2VsaW5rKCAkdGl0bGUsICRuaWNldXJsICkgew0KCSR0aXRsZSA9IHN0cnRvbG93ZXIoIGZpbHRlcl92YXIoIHN0cl9yZXBsYWNlKCAnICcsICdfJywgaW1sX2NoYXJyZXBsKCAkdGl0bGUgKSApLCBGSUxURVJfU0FOSVRJWkVfU1BFQ0lBTF9DSEFSUyApICk7DQoJJG5pY2V1cmwgPSBzdHJ0b2xvd2VyKCBmaWx0ZXJfdmFyKCBzdHJfcmVwbGFjZSggJyAnLCAnXycsICRuaWNldXJsICksIEZJTFRFUl9TQU5JVElaRV9TUEVDSUFMX0NIQVJTICkgKTsNCglpZiAoICEkbmljZXVybCApIHsNCgkJJG5pY2VsaW5rID0gZmlsdGVyX3ZhciggJHRpdGxlLCBGSUxURVJfU0FOSVRJWkVfVVJMICk7DQoJfSBlbHNlIHsNCgkJJG5pY2VsaW5rID0gZmlsdGVyX3ZhciggJG5pY2V1cmwsIEZJTFRFUl9TQU5JVElaRV9VUkwgKTsNCgl9DQoJcmV0dXJuICRuaWNlbGluazsNCn0=

Than add the following function to functions.php:
ZnVuY3Rpb24gaW1sX2NoYXJyZXBsKCAkc3RyaW5nICkgew0KICAgICRmaW5kID0gYXJyYXkoICfDgCcsJ8OBJywnw4InLCfDgycsJ8OEJywnw4UnLCfDhicsJ8OHJywnw4gnLCfDiScsJ8OKJywnw4snLCfDjCcsJ8ONJywnw44nLCfDjycsJ8OQJywnw5EnLCfDkicsJ8OTJywnw5QnLCfDlScsJ8OWJywnw6AnLCfDoScsJ8OiJywnw6MnLCfDpCcsJ8OlJywnw6YnLCfDpycsJ8OoJywnw6knLCfDqicsJ8OrJywnw6wnLCfDrScsJ8OuJywnw68nLCfDsCcsJ8OxJywnw7InLCfDsycsJ8O0Jywnw7UnLCfDticgKTsNCgkkcmVwbCA9IGFycmF5KCAnQScsJ0EnLCdBJywnQScsJ0EnLCdBJywnQUUnLCdDJywnRScsJ0UnLCdFJywnRScsJ0knLCdJJywnSScsJ0knLCdEJywnTicsJ08nLCdPJywnTycsJ08nLCdPJywnYScsJ2EnLCdhJywnYScsJ2EnLCdhJywnYWUnLCdjJywnZScsJ2UnLCdlJywnZScsJ2knLCdpJywnaScsJ2knLCdkJywnbicsJ28nLCdvJywnbycsJ28nLCdvJywnbycgKTsNCgkkdGV4dDEgPSBzdHJfcmVwbGFjZSggJGZpbmQsICRyZXBsLCAkc3RyaW5nICk7DQoJJHNlYXJjaCA9IGFycmF5ICgNCiAgICAgICAgICcvXCcvJywNCgkJICcvXCIvJywNCiAgICAgICAgICcvXCQvJywNCgkJICcvXMKjLycsDQoJCSAnL1zCpS8nLA0KCQkgJy9cwqIvJywNCgkJICcvXCUvJywNCiAgICAgICAgICcvXEAvJywNCgkJICcvXCYvJywNCgkJICcvXCMvJywNCgkJICcvXCovJywNCgkJICcvXH4vJywNCgkJICcvXF4vJywNCgkJICcvXGAvJywNCgkJICcvXCwvJywNCgkJICcvXC4vJywNCgkJICcvXCgvJywNCgkJICcvXCkvJywNCgkJICcvXFsvJywNCgkJICcvXF0vJywNCgkJICcvXHsvJywNCgkJICcvXH0vJywNCgkJICcvXHwvJywNCgkJICcvXDwvJywNCgkJICcvXD4vJywNCgkJICcvXD8vJywNCgkJICcvXCEvJywNCgkJICcvXC8vJywNCgkJICcvXDsvJywNCgkJICcvXDovJywNCgkJICcvXMKpLycsDQoJCSAnL1zCri8nICk7DQoJJHRleHQgPSBwcmVnX3JlcGxhY2UoICRzZWFyY2gsICcnLCAkdGV4dDEgKTsNCiAgICByZXR1cm4gJHRleHQ7DQp9

This filter applies to the title of a link only and not an alternative title.

_________________
McDonalds Store

2010/9/27 13:25:39
#11
Offline
Home away from home

Re: Imlinks performance

Thanks!! :thumbup:


2010/9/27 14:33:46
#12
Offline
Home away from home

Re: Imlinks performance

You might want to download the latest version of functions.php from the trunk here.
I've extended the lists of special characters yesterday.

_________________
McDonalds Store

2010/9/28 0:47:40
#13
Offline
Home away from home

Re: Imlinks performance

Tested: it works smoothly :bravo:


2010/9/28 9:39:03
#14
Offline
Home away from home

Re: Imlinks performance

I hope to publish RC-2 coming Thursday which also fixes the meta-tags (page title and meta-description).

_________________
McDonalds Store

2010/9/29 14:25:24
#15
Offline
Home away from home

Re: Imlinks performance

Okidoki.

imLinks 1.04 RC-2 is available from here for testing.

_________________
McDonalds Store

Reply New Topic extras
 Previous Topic   Next Topic
You can view topic.
You can start a new topic.
You can reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You can post without approval.