This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
5071
Other software / Re: PHP 5.4 bug, mods/plugins with hooks
« on May 27th, 2012, 07:29 PM »
+1 John ;)
5072
Archived fixes / Re : Optimizing parse_bbc() and Aeva
« on May 27th, 2012, 03:29 PM »
By external tests, I mean taking a few 'test' posts and seeing how parse_bbc() fares on them on a few different servers...
5073
Features / Re: Rewriting the skin file parser...
« on May 27th, 2012, 03:29 PM »
So, if I put a index.ie7,replace,ie6.css file into the folder, that would assume I want the parent folder's index.ie6,ie7.css and index.ie7,ie6.css files to be removed...? But not, say, index.ie6.css or index.ie6,ie7,ie8.css?
5074
Archived fixes / Optimizing parse_bbc() and Aeva
« on May 27th, 2012, 12:20 PM »
(Split from 'BBC whitespace trimming'.)
Would be helpful to see external tests.
Eh maybe one of my earlier micro optimizations fixed it ahah.
Would be helpful to see external tests.
Eh maybe one of my earlier micro optimizations fixed it ahah.
5075
Archived fixes / Re: BBC whitespace trimming
« on May 26th, 2012, 11:58 PM »
The img problem was due to Aeva, once again...
I added img to the exception list.
I'm guessing this will require a rewrite, still. I don't like the idea of this happening all too often....
I'm actually wondering whether I couldn't simply move all embedding code to parse_bbc(). Eh, why not... Footnotes are already there, after all. Why not the rest. Unless of course I forgot about a good reason to have it outside.
Re: performance, I made more tests, and I still can't get a full page to use more than 10% of the overall resources... (With a full page of regular posts + a few more complex ones.)
I really don't know what's hapenning. Maybe it's not in parse_bbc() itself...?!
I added img to the exception list.
I'm guessing this will require a rewrite, still. I don't like the idea of this happening all too often....
I'm actually wondering whether I couldn't simply move all embedding code to parse_bbc(). Eh, why not... Footnotes are already there, after all. Why not the rest. Unless of course I forgot about a good reason to have it outside.
Re: performance, I made more tests, and I still can't get a full page to use more than 10% of the overall resources... (With a full page of regular posts + a few more complex ones.)
I really don't know what's hapenning. Maybe it's not in parse_bbc() itself...?!
5076
Archived fixes / Re: BBC whitespace trimming
« on May 26th, 2012, 10:35 PM »
So... I made this post with several list items and a six-cell table, an image and a raw URL, and got it parsed in less than 2 milliseconds... It's pretty much weird that there are performance issues at all?!
Also, a bug! Another...
When you choose to add a link, it shows the img tag and the URL in between. Once you submit, it gets submitted as this:
Code: [Select]
Ahhhhh... Again.
Also, a bug! Another...
When you choose to add a link, it shows the img tag and the URL in between. Once you submit, it gets submitted as this:
[img]http://[url]http://wedge.org/welog.png[/url][/img]Ahhhhh... Again.
5077
Archived fixes / Re: BBC whitespace trimming
« on May 26th, 2012, 09:44 PM »
I did a few tests earlier and the only offenders were the Aeva and media tags actually...
Shall I keep the strlen db cache then btw?
Posted: May 26th, 2012, 09:43 PM
Shall I keep the strlen db cache then btw?
5078
Archived fixes / Re: BBC whitespace trimming
« on May 26th, 2012, 09:30 PM »
Do you have a sample post available that is known to be a horrible speed offender? That'd be great...
5079
Archived fixes / Re: BBC whitespace trimming
« on May 26th, 2012, 07:57 PM »I see what you mean, but I'm bothered by the fact we'd have to convert only known tags - any unknown tags would have to be left alone in case the user intentionally did that.
I mean, do you know of many users who manually type their tags, and when they do, they're not geeks and thus don't follow the common use of lowercase for tags...?
You'd want that left alone.
(I had the tab open from this morning, then had to go do shopping and stuff)
I only know vaguely about the way it works or is supposed to work, it's not something I spent long looking at :(
I do agree with storing strlen, though, that would likely be advantageous.
Heck, actually I made some benchmarking over the entire parse_bbc() code, and I nearly always get very high performance (e.g. a few milliseconds per post, even with multiple tags in them)...
I don't really know what's slowing it down, then.
Maybe it's a waste of time...
5080
Archived fixes / Re: BBC whitespace trimming
« on May 26th, 2012, 07:40 PM »
Oh well, I knew this wouldn't generate any comments... ::)
Anyway, I'm currently working on this. Trying to optimize parse_bbc() as well -- the folly!!
Heck, I've even created a static array, $strlower, which holds a lowercase version of the ASCII table, just to optimize ONE call to strtolower() that gets executed on each new tag found... It's probably a bit TOO silly -- although this call is now a whopping 3 times faster... Uh.
I'm also considering something else that could be a much better improvement.
Say we do, at SMF import time, a conversion of all tags to lowercase...
Now, in preparsecode(), we convert all tags to lowercase just the same.
See what I mean...? parse_bbc() suddenly no longer has to care for strtolower or stripos. And believe me, stripos is used quite a lot of time, and I know from experience that it's nearly as slow as doing a strpos(strtolower())...
What do you think?
Also... Maybe we could store strlen($tag) inside the database...? It would save us a call to strlen() for each and every possible tag being tested against... (Heck, it would probably even be faster to just calculate and store the strlen in the bbcode cache at the beginning of the function... Because, let's say you have dozens of "tt" tags in your post: for each of them, it'll be calculating strlen('table'), strlen('td'), strlen('time'), strlen('tr') and strlen('tt')... Funny hey?)
Anyway, I'm currently working on this. Trying to optimize parse_bbc() as well -- the folly!!
Heck, I've even created a static array, $strlower, which holds a lowercase version of the ASCII table, just to optimize ONE call to strtolower() that gets executed on each new tag found... It's probably a bit TOO silly -- although this call is now a whopping 3 times faster... Uh.
I'm also considering something else that could be a much better improvement.
Say we do, at SMF import time, a conversion of all tags to lowercase...
Now, in preparsecode(), we convert all tags to lowercase just the same.
See what I mean...? parse_bbc() suddenly no longer has to care for strtolower or stripos. And believe me, stripos is used quite a lot of time, and I know from experience that it's nearly as slow as doing a strpos(strtolower())...
What do you think?
Posted: May 26th, 2012, 07:33 PM
Also... Maybe we could store strlen($tag) inside the database...? It would save us a call to strlen() for each and every possible tag being tested against... (Heck, it would probably even be faster to just calculate and store the strlen in the bbcode cache at the beginning of the function... Because, let's say you have dozens of "tt" tags in your post: for each of them, it'll be calculating strlen('table'), strlen('td'), strlen('time'), strlen('tr') and strlen('tt')... Funny hey?)
5081
Archived fixes / BBC whitespace trimming
« on May 26th, 2012, 10:46 AM »
So, some time ago I changed quote tags to use whitespace trimming, so that I could precisely style the space between quotes and surrounding text.
Turned out that it didn't work very well.
The first problem was with margins. I used margin collapsing to allow for an opener quote not to take any useless space at the top of a post, but if you quoted that, it would add the extra space inside the new quote. I fixed it this morning by adding an extra div directly above the blockquote tag. I fought long and hard against that (even trying for pseudo-elements to fill in the gap...), until I realized I'd provisioned for an empty <footer> tag in the markup. So I simply removed the footer tag (which can very well be 'emulated' through pseudo-elements, like .bbc_quote:after, well, maybe not, but it can always be re-inserted by a plugin through a SQL query), and replaced them with the div tags. 'div' is shorter than 'footer', and it's acceptable. (Heck, I'm even considering turning <div class="bbc_quote"> into <section class="bbc_quote"> because of the header, but whatever...)
So, problem solved.
Now, there's an extra problem. The trimming code.
Let's say you have some text, then a few empty lines, then a quote, then a few empty lines, then some text.
Wedge (and SMF, I guess) will only remove the TRAILING empty lines. Any empty lines BEFORE the quote tag are left as is.
I was wondering why, and it turned out that... Well, it seems that these are never even looked against...?!
So, quotes are set to trim 'outside', to me that means "before and after the tag"...
But it seems that the two 'outside' trimming code blocks are both about 'anything coming after the tag'.
And if anything -- the regexps both start with '^' and have no closer '$', which doesn mean "look for whitespace at the beginning of the string...", when we should have at some point a test against whitespace soming before the tag, i.e. a test against substr($message, 0, $pos) (with $pos representing the start of a tag, and a regexp ending with $), instead of substr($message, $pos), with $pos representing the end of the tag and the regexp starting with ^, like it is now...
Do you think it's an oversight? In SMF, 'outside' is only used on 'td' and 'li'. I can understand that one would want to only test for whitespace once because if anything, there's little chance of having any text between two td or li tags, so if you test for trailing whitespace, you don't need to test for leading whitespace on the next tag because it's likely to have been removed already... Yet, it isn't working that way in my opinion.
Maybe I should add support for a new trimming codeword that would cover both directions... I don't know.
Anyone here knows about everything I've been talking about...?
Turned out that it didn't work very well.
The first problem was with margins. I used margin collapsing to allow for an opener quote not to take any useless space at the top of a post, but if you quoted that, it would add the extra space inside the new quote. I fixed it this morning by adding an extra div directly above the blockquote tag. I fought long and hard against that (even trying for pseudo-elements to fill in the gap...), until I realized I'd provisioned for an empty <footer> tag in the markup. So I simply removed the footer tag (which can very well be 'emulated' through pseudo-elements, like .bbc_quote:after, well, maybe not, but it can always be re-inserted by a plugin through a SQL query), and replaced them with the div tags. 'div' is shorter than 'footer', and it's acceptable. (Heck, I'm even considering turning <div class="bbc_quote"> into <section class="bbc_quote"> because of the header, but whatever...)
So, problem solved.
Now, there's an extra problem. The trimming code.
Let's say you have some text, then a few empty lines, then a quote, then a few empty lines, then some text.
Wedge (and SMF, I guess) will only remove the TRAILING empty lines. Any empty lines BEFORE the quote tag are left as is.
I was wondering why, and it turned out that... Well, it seems that these are never even looked against...?!
So, quotes are set to trim 'outside', to me that means "before and after the tag"...
But it seems that the two 'outside' trimming code blocks are both about 'anything coming after the tag'.
And if anything -- the regexps both start with '^' and have no closer '$', which doesn mean "look for whitespace at the beginning of the string...", when we should have at some point a test against whitespace soming before the tag, i.e. a test against substr($message, 0, $pos) (with $pos representing the start of a tag, and a regexp ending with $), instead of substr($message, $pos), with $pos representing the end of the tag and the regexp starting with ^, like it is now...
Do you think it's an oversight? In SMF, 'outside' is only used on 'td' and 'li'. I can understand that one would want to only test for whitespace once because if anything, there's little chance of having any text between two td or li tags, so if you test for trailing whitespace, you don't need to test for leading whitespace on the next tag because it's likely to have been removed already... Yet, it isn't working that way in my opinion.
Maybe I should add support for a new trimming codeword that would cover both directions... I don't know.
Anyone here knows about everything I've been talking about...?
5082
Test board / Re: Test topic.
« on May 26th, 2012, 10:04 AM »
Edit test...Quote from Nao on May 26th, 2012, 10:04 AM Nested quotes.Quote from Nao on May 26th, 2012, 10:04 AM Nested quotes.Quote from Nao on May 26th, 2012, 10:04 AM Quote from Nao on May 26th, 2012, 10:04 AM Nested quotes.
Testing.Quote from Nao on April 24th, 2012, 11:03 PM You already did on march 31 ;)
Testing.Quote from Nao on April 24th, 2012, 11:03 PM You already did on march 31 ;)
Testing.Quote from Nao on April 24th, 2012, 11:03 PM You already did on march 31 ;)
Testing.Quote from Nao on April 24th, 2012, 11:03 PM You already did on march 31 ;)
5083
Test board / Re: Test topic.
« on May 26th, 2012, 10:04 AM »You already did on march 31 ;)
[media id=1][media id=1]
5084
The Pub / Re: Improvement to drafts (and posting, actually) I need to do
« on May 26th, 2012, 10:03 AM »
Suggesting an improvement for drafts...
I submitted a post and got a "There was a reply..." message and the full post again.
I then got a browser crash while opening Dragonfly. (Thank you, Opera 12...)
I restarted, and my draft only had half of the post.
So my suggestion would be to save the draft automatically when you hit Preview or you get an error message and the full post page.
What do you think...?
I submitted a post and got a "There was a reply..." message and the full post again.
I then got a browser crash while opening Dragonfly. (Thank you, Opera 12...)
I restarted, and my draft only had half of the post.
So my suggestion would be to save the draft automatically when you hit Preview or you get an error message and the full post page.
What do you think...?
5085
Features / Re: Thought system
« on May 26th, 2012, 08:55 AM »That's the point, the notifications system I'm talking about doesn't go away straight away - it lives for a few days.
I'd tend to say, "people should be able to subscribe to a custom web/xml feed that takes whatever data they want from whatever account they want...", and that shouldn't be linked to a specific wall. (It'd just be, somehow... "choose what kind of data you want to see in your aggregated wall.")
It still doesn't solve the issues of where we store this data, whether we use the thoughts table, and where we store the comments :^^;:
You wouldn't normally notify all your friends on an action. You would, however, normally notify them if it's a thread they're watching and you reply to it. Or like it etc.
This is also the thing about having a wall - it magnifies a lot of things, in a way that a notifications system doesn't; notifications are essentially personal while a wall is everyone's, and I don't particularly want to build a social network (even if a forum is a specific type of that)