cssin
cssin copied to clipboard
CSSIN-inlineCSS() call takes 8 sec on my Core I 5 server
As you can see
InlineCSS() takes 73%(8 sec) of all my script InlineCSS() calls 1)parseCSS(41.99 %) 2)simple_dom_data->find(25 %) (may be http://ru2.php.net/manual/en/book.dom.php can be used ?)
parseCSS() calls csstidy->parse(38.67%)
csstidy->is_token is called 33084 times !
For example smarty engine takes only 1.63 % of all the script's time
207 SQL queries take 3.61 % SMTP phpmailer takes 8.47%
[~/tmp/cssin/src]$ time php test.php php test.php 0,35s user 4,96s system 59% cpu 8,922 total
This call takes 8,922 sec
<?php
require_once 'CSSIN.php';
$cssin = new FM\CSSIN();
$html_with_inlined_css = $cssin->inlineCSS('http://demo.x-cart.com/demo/order.php?mode=invoice&orderid=1003&access_key=fb760e6fd95aaafe');
?>
If you know a viable alternative to csstidy I'll take it, but it's the most reliable I've found...
To solve this problem you need to cache parsed file and reuse it.
If you know a viable alternative to csstidy I'll take it, but it's the most reliable I've found...
Maybe it will work faster https://github.com/Cerdic/CSSTidy