webman 中间件多的话 每个中间件里面都要 $post_data = $request->post(); 是不是会影响性能 有什么好的方式吗?

bigman

webman 中间件多的话 每个中间件里面都要 $post_data = $request->post(); 是不是会影响性能 有什么好的方式吗?

566 1 0
1个回答

keytehu

想多了,php这种变量赋值每秒可以几千万次,你这才几次赋值耗时估计也就0.000000x秒,
然而一个sql要耗时0.001至0.01秒,优化sql或者少执行一次sql可能顶你优化100万个赋值语句。

  • bigman 2022-09-23

    ->post() 会过滤的操作比如xxs等等

年代过于久远,无法发表回答
🔝