redis-doc icon indicating copy to clipboard operation
redis-doc copied to clipboard

lolwut is missing computational complexity

Open stockholmux opened this issue 6 years ago • 9 comments

stockholmux avatar Oct 28 '19 13:10 stockholmux

Hello @stockholmux

LOLWUT is not a regular command, and imo complexity is meaningless for it.

itamarhaber avatar Oct 28 '19 15:10 itamarhaber

I'm with you however... LOLWUT output should be fast to generate so that the command can be called in production instances without issues. It should remain fast even when the user experiments with odd parameters. this seems meaningless (or more of a requirement rather than docs).

If we're saying 'run it on production' perhaps we need to back that up with something reasonable.

stockholmux avatar Oct 28 '19 16:10 stockholmux

The complexity for each different LOLWUT may also be different, depending on what it does and the args it takes... Perhaps it would be better to retract the "safe to run in production" claim rather than try and work out a reasonable complexity to constrain future LOLWUTs to..?

AngusP avatar Nov 20 '19 14:11 AngusP

@AngusP Fair enough. I would support removing 'run in production' to solve this particular issue.

stockholmux avatar Nov 20 '19 14:11 stockholmux

Hey folks, since LOLWUT has always hard limits to the arguments that may make it more expensive, it is effectively an O(1) command.

antirez avatar Nov 20 '19 16:11 antirez

I would say that every LOLWUT version which is not O(1), has a bug.

antirez avatar Nov 20 '19 16:11 antirez

BTW, besides LOLWUT, we also have the following non-complexified commands - would it make sense iyo to add complexity to these as well?

  • AUTH
  • BGREWRITEAOF
  • BGSAVE
  • CONFIG GET
  • CONFIG REWRITE
  • CONFIG SET
  • DBSIZE
  • DEBUG OBJECT
  • DEBUG SEGFAULT
  • DISCARD
  • ECHO
  • EXEC
  • FLUSHALL
  • FLUSHDB
  • INFO
  • LASTSAVE
  • MEMORY DOCTOR
  • MEMORY HELP
  • MEMORY MALLOC-STATS
  • MEMORY PURGE
  • MEMORY STATS
  • MONITOR
  • MULTI
  • PING
  • QUIT
  • ROLE
  • SAVE
  • SELECT
  • SHUTDOWN
  • SLAVEOF
  • REPLICAOF
  • SLOWLOG
  • SWAPDB
  • SYNC
  • PSYNC
  • LATENCY DOCTOR
  • LATENCY GRAPH
  • LATENCY HISTORY
  • LATENCY LATEST
  • LATENCY RESET
  • LATENCY HELP

itamarhaber avatar Nov 20 '19 19:11 itamarhaber

I think it would be good to either give a time-complexity, or a quick note as-to why there isn't one. Some of those given above by @itamarhaber are certainly expensive! (BGREWRITEAOF, SAVE, REPLICAOF, etc.)

e.g. in the case of EXEC, it itself adds basically no time (O(1)) but the transaction runtime depends on what you put in the transaction...

AngusP avatar Nov 20 '19 19:11 AngusP

Maybe we should have a shared sheet with this commands and the time complexity, and work at the list. When looks ok, we can put it into the JSON.

antirez avatar Nov 21 '19 16:11 antirez

This was determined to be a code issue/requested enhancement, closing.

mich-elle-luna avatar Dec 23 '23 00:12 mich-elle-luna