Skip to main content
Known Participant
May 6, 2010
Question

FMS JavaScript engine: how many properties is too many for an object?

  • May 6, 2010
  • 1 reply
  • 448 views

I know the engine is derived from Mozilla SpiderMonkey.

I am using an object which properties are IP addresses, i mean literally, as in:

object["123.456.789.012"]

The object is a map of banned clients. The number of properties approaches several hundreds. I wonder if this is a strain on the engine in any way?

The reason I use this is because property lookup is just about the fastest thing you can do, as opposed to say an array with indexes and ip addresses as values, which would be an O(n) operation when doing lookup.

    This topic has been closed for replies.

    1 reply

    May 6, 2010

    In javascript (in general), an array limit would be 4,294,967,295 properties.

    That said, the maximum javascript runtime size for SpiderMonkey as implemented in FMS is 50MB, so keep that in mind when planning your strategy.