Skip to content

Conversation

@casperisfine
Copy link

It's not a lot, but some of the strings in these generated files are duplicated and a bit of memory could be saved by enabling frozen_string_literal.

There's another source of duplication that could be removed, but not sure if you'd be open to the fix.

For instance:

# encoding: UTF-8

# This file contains data derived from the IANA Time Zone Database
# (https://www.iana.org/time-zones).

module TZInfo
  module Data
    module Definitions
      module Cuba
        include TimezoneDefinition
        
        linked_timezone 'Cuba', 'America/Havana'
      end
    end
  end
end

Here "Cuba" exist twice, one is the backing string for :Cuba symbol, because they are automatically casted as US-ASCII when applicable:

>> Cuba.name.encoding
=> #<Encoding:US-ASCII>

So a trick to reduce the memory further could be to set # encoding: US-ASCII.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants