The main overhead here is the multiple individual inserts in the data warehouse. If you can, save the links as a whole, as Andre suggests. You can always split array references and store it in ListProperty.
If you need an entity for each link, try the following:
# For each line in the input, add to the database groups = [] for x in allLinks: newGroup = LinkGrouping() newGroup.reference = hash newGroup.link = x groups.append(newGroup) db.put(groups)
This will reduce the number of accesses to the data warehouse to one, and these are circular transitions that really kill your high processor cap.
source share