Laggy Tilemap Problem

I have some code for creating a tilemap, the issue I’m having is that it begins to lag greatly going over even 10 objects. Am I doing something wrong with it?

class DisplayData{
  private var tilemap:Tilemap;
  private var tileset:Tileset;
  private var tile:Tile;
  private var _container:DisplayObjectContainer;
  public var position:Point;

  public function new(){
    _container = Lib.current.stage;

  public function setTile(imgFile:String) {
    var bitmapData = Assets.getBitmapData(imgFile);
    var tileset = new Tileset(bitmapData);
    tileset.addRect (bitmapData.rect);
    var tilemap = new Tilemap (800, 600, tileset);
    tile = new Tile(0);
    tilemap.addTile (tile);


Can you add them to the same Tilemap?