View Single Post
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 12-04-2017 , 06:17   Re: a small question: fgets or read_file, which is faster?
Reply With Quote #9

Quote:
Originally Posted by DjSoftero View Post
so I just wrote crap ton of config file reading just to recode everything. nice
shouldn't matter if you only do the file parsing once per map (like to read a config)

Quote:
Originally Posted by HamletEagle View Post
I'm not entirely sure, client_disconnect is deprecated because it wasn't working quite right. write_file/read_file are working, they are just inefficient. That's up to Arkshine I guess.
true, but there is no reason to use *_file instead of f*(), maybe no reason to keep them except backwards compatibility, so it should be avoided for newly written scripts

I'm also considering which topics is google more likely to fetch when people search "amxx write to file" or "amxx read from file", also this tut which popped up for me https://forums.alliedmods.net/showthread.php?t=46218 which although explains both methods quite well, a lot of newbs might be tempted to go for "quick and easy"

this is kind of what happened with mysql_*() functions in PHP, technically not broken but still deprecated due to more secure stuff being added, yet still too many people use it
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline