Q:

Performance - Ruby - Compare large array of hashes (dictionary) to primary hash; update resulting value

I'm attempting to compare my data, which is in the format of an array of hashes, with another large array of hashes (~50K server names and tags) which serves as a dictionary.  The dictionary is stripped down to only include the absolutely relevant information.
The code I have works but it is quite slow on this scale and I haven't been able to pinpoint why.  I've done verbose printing to isolate the issue to a specific statement (tagged via comments below)--when it is commented out, the code runs ~30x faster.
After reviewing the code extensively, I feel like I'm doing something wrong and perhaps Array#select is not the appropriate method for this task.  Thank you so much in advance for your help.
Code:
inventory = File.read('inventory_with_50k_names_and_associate_tag.csv')

# Since my CSV is headerless, I'm forcing manual headers
@dictionary_data = CSV.parse(inventory).map do |name|
  Hash[ [:name, :tag].zip(name) ]
end

# ...
# API calls to my app to return an array of hashes is not shown (returns '@app_data')
# ...

@app_data.each do |issue| 

  # Extract base server name from FQDN (e.g. server_name1.sub.uk => server_name1)
  derived_name = issue['name'].split('.').first

  # THIS IS THE BLOCK OF CODE that slows down execution 30 fold:
  @dictionary_data.select do |src_server|
    issue['tag'] = src_server[:tag] if src_server[:asset_name].start_with?(derived_name)
  end

end

Sample Data Returned from REST API (@app_data):
@app_data = [{'name' => 'server_name1.sub.emea', 'tag' => 'Europe', 'state' => 'Online'}
             {'name' => 'server_name2.sub.us', 'tag' => 'US E.', 'state' => 'Online'}
             {'name' => 'server_name3.sub.us', 'tag' => 'US W.', 'state' => 'Failover'}]

Sample Dictionary Hash Content:
@dictionary_data = [{:asset_name => 'server_name1-X98765432', :tag => 'Paris, France'}
                    {:asset_name => 'server_name2-Y45678920', :tag => 'New York, USA'}
                    {:asset_name => 'server_name3-Z34534224', :tag => 'Portland, USA'}]

Desired Output:
@app_data = [{'name' => 'server_name1', 'tag' => 'Paris, France', 'state' => 'Up'}
             {'name' => 'server_name2', 'tag' => 'New York, USA', 'state' => 'Up'}
             {'name' => 'server_name3', 'tag' => 'Portland, USA', 'state' => 'F.O'}]

A:

Assuming "no" on both of my questions in the comments:
#!/usr/bin/env ruby

require 'csv'

@dictionary_data = CSV.open('dict_data.csv') { |csv|
  Hash[csv.map { |name, tag| [name[/^.+(?=-\w+$)/], tag] }]
}

@app_data = [{'name' => 'server_name1.sub.emea', 'tag' => 'Europe', 'state' => 'Online'},
             {'name' => 'server_name2.sub.us', 'tag' => 'US E.', 'state' => 'Online'},
             {'name' => 'server_name3.sub.us', 'tag' => 'US W.', 'state' => 'Failover'}]

STATE_MAP = {
  'Online' => 'Up',
  'Failover' => 'F.O.'
}

@app_data = @app_data.map do |server|
  name = server['name'][/^[^.]+/]
  {
    'name' => name,
    'tag' => @dictionary_data[name],
    'state' => STATE_MAP[server['state']],
  }
end

p @app_data
# => [{"name"=>"server_name1", "tag"=>"Paris, France", "state"=>"Up"}, 
#    {"name"=>"server_name2", "tag"=>"New York, USA", "state"=>"Up"}, 
#    {"name"=>"server_name3", "tag"=>"Portland, USA", "state"=>"F.O."}]

EDIT: I find it more convenient here to read the CSV without headers, as I don't want it to generate an array of hashes. But to read a headerless CSV as if it had headers, you don't need to touch the data itself, as Ruby's CSV is quite powerful:
CSV.read('dict_data.csv', headers: %i(name tag)).map(&:to_hash)

