Its not social engine 4 script problem, its because Social Engine 4 using InnoDB database, Problem lies inside your database and your server MYSQL configuration, you need to configure something in your MY SQL, and for this you need good VPS having 1-2gb ram or Dedicated Server with 4-8gb ram and keep in mind Social Engine 4 cannot be hosted on shared servers because you cannot set that value to your server while on shared hosting. It still consumes your server ram, thats why cannot be hosted on Shared Servers but your site will get a boost performance.
Its not Social Engine is slow, Social Engine InnoDB database takes all over your server ram and when ram consumed by Server, your server looses its performance and your site will also looses its performance.
Ok here is solution to control Ram Buffer and some other things for innodb
For my UBUNTU LINUX SERVER EDITION 10.4 LTS its file location
its configuration file of MYSQL
add these line in the end of file, and make sure entry should not be double, kindly search for same line in file before
innodb_buffer_pool_size=2M innodb_additional_mem_pool_size=1M innodb_log_file_size=2M innodb_log_buffer_size=2M innodb_flush_log_at_trx_commit=2 innodb_lock_wait_timeout=50 innodb_thread_concurrency=8
After adding this code, restart your MYSQL