I'm using Nokogiri/Ruby to parse a very large XML document (~300k lines). It's been taking around five minutes to process each record, and I determined that the last line in the code below is taking up 99% of that time. Any suggestions on how to speed up the search? Could it be an issue with system memory (or lack thereof) by any chance?
doc = Nokogiri::XML(File.read(ARGV[0]))
orders = doc.xpath("//order")
order = orders.xpath("//order[account_number=#{sap_account}]")