减少网站的等待时间(Decrease waiting time for a website)
我们正在尝试创建一个新网站,当我在浏览器ex:www.mywebsite.com上写下我的网站链接时,等待时间有点高。
我看到一些网站的等待时间比我的要低,是否可以减少等待时间,我们也在网站上使用memcached?
PS:idk究竟是怎样调用的,但我用firebug看到它,它说等待时间。
谢谢。
EDITED
这是我用来从数据库中获取数据的代码:
function f3($id = '') { $id = mysql_real_escape_string ($id); $sql = 'SELECT id,post_title,post_content,post_date,post_status,term_taxonomy_id,object_id FROM wp_posts, wp_term_relationships WHERE term_taxonomy_id = 60 AND post_status = "publish" AND wp_term_relationships.object_id = id ORDER BY post_date DESC LIMIT 1 OFFSET 2'; $res = mysql_query($sql) or die (mysql_error()); if (mysql_num_rows($res) !=0): $row = mysql_fetch_assoc($res); $mycontent = $row['post_content']; $mycontent = strip_tags($mycontent); $mycontent = substr($mycontent,0,150); $mycontent = preg_replace("/\[caption.*\[\/caption\]/", '', $mycontent); $title = AvinD($row['post_title']); $old_date = $row['post_date']; // returns Saturday, January 30 10 02:06:34 $old_date_timestamp = strtotime($old_date); $new_date = date('d.m.Y H:i', $old_date_timestamp); $first_img = ''; $my1content = AvinD($row['post_content']); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $my1content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ //Defines a default image $first_img = "/img/default.png"; } echo ' '.$new_date.' <a href="single.php?id='.$row['id'].'"> '.$title.' </a> </div> <a href="single.php?id='.$row['id'].'"> <img src="timthumb.php?src='.$first_img.'&h=107&w=190amp;zc=1" alt="" /> </a> </div> '.$mycontent.' '; //echo else: echo 'Page dont exist'; endif; } // end
We are trying to create a new website, and when i write the link of my website on the browser ex: www.mywebsite.com, the waiting time is a bit high.
I have seen some website that has a lower waiting time then mine, is any way to decrease the waiting time , also we are using memcached for the website?
PS: idk exactly how is called, but i see it with firebug, and it says waiting time.
Thank you.
EDITED
This is the codes i have used to get data from database:
function f3($id = '') { $id = mysql_real_escape_string ($id); $sql = 'SELECT id,post_title,post_content,post_date,post_status,term_taxonomy_id,object_id FROM wp_posts, wp_term_relationships WHERE term_taxonomy_id = 60 AND post_status = "publish" AND wp_term_relationships.object_id = id ORDER BY post_date DESC LIMIT 1 OFFSET 2'; $res = mysql_query($sql) or die (mysql_error()); if (mysql_num_rows($res) !=0): $row = mysql_fetch_assoc($res); $mycontent = $row['post_content']; $mycontent = strip_tags($mycontent); $mycontent = substr($mycontent,0,150); $mycontent = preg_replace("/\[caption.*\[\/caption\]/", '', $mycontent); $title = AvinD($row['post_title']); $old_date = $row['post_date']; // returns Saturday, January 30 10 02:06:34 $old_date_timestamp = strtotime($old_date); $new_date = date('d.m.Y H:i', $old_date_timestamp); $first_img = ''; $my1content = AvinD($row['post_content']); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $my1content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ //Defines a default image $first_img = "/img/default.png"; } echo ' '.$new_date.' <a href="single.php?id='.$row['id'].'"> '.$title.' </a> </div> <a href="single.php?id='.$row['id'].'"> <img src="timthumb.php?src='.$first_img.'&h=107&w=190amp;zc=1" alt="" /> </a> </div> '.$mycontent.' '; //echo else: echo 'Page dont exist'; endif; } // end
原文:https://stackoverflow.com/questions/7265821
最满意答案
您可以使用
void funct(FILE *arch) { _asm{ mov eax, arch mov eax,[eax]archivo.info mov byte ptr [eax],'b' } }
或更好
__declspec(naked) void __fastcall funct2(FILE * /*arch*/) { _asm{ mov eax,[ecx]archivo.info mov byte ptr [eax],'b' ret } }
you can use
void funct(FILE *arch) { _asm{ mov eax, arch mov eax,[eax]archivo.info mov byte ptr [eax],'b' } }
or better
__declspec(naked) void __fastcall funct2(FILE * /*arch*/) { _asm{ mov eax,[ecx]archivo.info mov byte ptr [eax],'b' ret } }
相关问答
更多-
在宏中使用时,尝试使用反斜杠前缀参数名称。 例如: movl \n, %eax 来源: 迈克尔 Try to prepend the argument names with a backslash when using them inside the macro. For example: movl \n, %eax Source: Michael
-
大会8086(IA32)添加两个数组元素的麻烦(Assembly 8086 (IA32) trouble with adding elements of two arrays)[2023-03-20]
你确实观察到了这种行为,并且你(主要是?)对他们是正确的。 movl $array1, %eax vs movl array1, %eax :是,第一个将加载带有内存地址的eax ,第二个将从内存(从该地址)加载带有32位值的eax 。 我在讨论如何实际注册商店内容时遇到了一些麻烦。 像eax这样的通用寄存器是32位寄存器(在支持64位的现代x86 CPU上, eax是rax的低32位部分,即64位寄存器)。 这意味着,该寄存器包含32位值(0或1)。 没有其他的。 调试器除非将其切换为不同的解释,否则通常 ... -
您需要检查装配的其他部分。 例如,如果将M和N都定义为8,则会在程序集中找到以下内容 array1: .zero 256 array2: .zero 256 因为在我的机器上,int是4个字节,8倍8是64.并且64 * 4 = 256.可以在这里找到样本组件。 Alright guys, after much research I was able to find a solution. Correct me if I am wrong. So going through the ...
-
LEA不访问内存,它只执行(地址)算术。 因此你的版本#2是正确的。 请注意,在x86 LEA上不会影响标志,而ADD LEA影响标志。 LEA还支持更复杂的有效地址语法,但转录到y86却非常简单。 例如, leal offset(%eax, %ebx, 4), %edx 变为: rrmovl %ebx, %edx addl %edx, %edx addl %edx, %edx addl %eax, %edx pushl %eax # save eax which used as te ...
-
不要忘记符号位。 现在你只能用正数来计算。 如果您使用负值处理,则术语的结果可能会溢出32位寄存器。 因此,将此结果存储在两个32位寄存器中。 res是一个64位变量(long long),即8个字节。 您将%eax存储为res - 只有4个字节。 上面的4个字节保持为空( long long res=0; )。 因此结果将始终为正,因为符号位(最高字节的最高位)为空。 TL; DR--尝试了解以下功能: function: pushl %ebx # to be ...
-
当给定32位操作数时, imul指令执行带符号的32x32位乘法。 这产生高达64位的结果,但是在两个/三个操作数形式中,只有最低有效字保持通过进位指示的溢出。 请注意,进位只是用于错误检测的单位标志,并且不能携带将多个扩展精度乘法链接在一起所需的信息。 在这种情况下,在最新的编辑之后,似乎目标是将两个64位变量相乘并获取截断的64位结果。 使用32x32 => 64位原语实现这一点需要将四次乘法链接到等级学校方法。 那是(a<<32|b) * (c<<32|d) = (a*c<<64) + (a*d<<3 ...
-
asm的前两行实际上是C的第一行但反转并分为两部分: sub = y; // movl 12(%ebp), %edx sub -= z; // subl 16(%ebp), %edx 你似乎有一点点麻烦,因为at&t语法(这是)将目标操作数放在右边。 就像这样的movl %edx, %eax确实是在代码中写的result = sub 。 此外, imull 8(%ebp), %edx清楚地写入edx因此sub = x * result ...
-
IA32大会:lea指令(IA32 Assembly: lea instruction)[2022-05-12]
我理解它的方式,lea / leal找出第一个操作数的内存地址,并将该地址写入第二个操作数(可能是一个寄存器左右)。 听起来很准确。 它用于执行地址算术; 这可以像加载地址一样简单,但您也可以使用它来执行某些常量的乘法运算。 pushl (%eax)显然不起作用。 为什么不? 你的push指令没有引用你认为它的地址: printf返回写入的字符数,并且该值在%eax寄存器中返回,因此%eax不再包含var的地址。 The way I understand it, lea/leal finds out the ... -
您可以使用 void funct(FILE *arch) { _asm{ mov eax, arch mov eax,[eax]archivo.info mov byte ptr [eax],'b' } } 或更好 __declspec(naked) void __fastcall funct2(FILE * /*arch*/) { _asm{ mov eax,[ecx]archivo.info mov ...
-
除非存在一些反调试cmp_strings() , cmp_strings()只接受两个在test_string()给出的参数。 当然,它们都是字符串,第一个字符串取自一个常量位置0x804a46c ,而第二个字符串(指向它的指针,当然不是字符串本身)是test_string()一个参数。 在调用之前,堆栈看起来像这样: |_______________| ESP: |
| <-- cmp_strings() 1st arg +04: | 0x804a46c | ...