Copying an object with python without actually creating a new object I ran across this script on another forum and would like to implement it. However, I'm running into a major bottle neck (performance-wise) when it gets to linking the new objects back to the scene because in my actual implementation I'm attempting to generate about 1000 cubes. 

From my understanding, it sounds as though there is a way to duplicate the object, but keep the duplicate as a part of the original object as is done in Edit Mode when using Shift+D.

import bpy
from mathutils import Vector

ob = bpy.context.object
obs = []
sce = bpy.context.scene

for i in range(-48, 48, 3):
    for j in range(-48, 48, 3):
        copy = ob.copy()
        copy.location += Vector((i, j, 0))
        copy.data = copy.data.copy()
        obs.append(copy)

for ob in obs:
    sce.objects.link(ob)

sce.update()


How would I go about implementing a similar script but instead of creating separate copies of the object just add them to the existing object eliminating the need for the loop that links objects back to the scene?
If it's speed you are going for

import bpy
from bpy import context

obj = context.active_object

# add two array modifiers
count = 32
arrays = {"x": (1.5, 0, 0),
          "y": (0, 1.5, 0)}

for axis, displace in arrays.items():          
    mod = obj.modifiers.new(axis, 'ARRAY')
    mod.count = count
    mod.relative_offset_displace = displace
    bpy.ops.object.modifier_apply(modifier=mod.name)

bpy.ops.object.origin_set()