low performance in high data recorders (Dom)

low performance in high data recorders (Dom)

islam.s.e.lislam.s.e.l Posts: 3Questions: 1Answers: 0

hallo ..
I am a beginner in MVC 5 have a problem in manage large data when i use datatables
this my code is there is any better way to get high performance

http://debug.datatables.net/umutan

@using MVCReportsPoducts.Models;

@{
productsEntities db = new productsEntities();
var data = (from log in db.userLog
join user in db.Tbl_Users on log.userID equals user.id_increment
select new { userName = user.Full_Name, form = log.form, _event = log.@event, data = log.data, date = log.date.ToString() });

//
ViewBag.Title = "User Log";
Layout = "~/Views/Shared/_LayoutPage.cshtml";

}

User Log

@Html.Partial("~/Views/Shared/ViewDTP.cshtml") @foreach (var item in data) { }
User Name Form Event Data Date
@Html.DisplayFor(modelItem => item.userName) @Html.DisplayFor(modelItem => item.form) @Html.DisplayFor(modelItem => item._event) @Html.DisplayFor(modelItem => item.data) @Html.DisplayFor(modelItem => item.date)
$(document).ready(function () { $('#tblUserLog').DataTable(); }); $('.form_date').change(function () { alertify.success($('#dtp').val()); });

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,309Questions: 26Answers: 4,947

    It looks like your table is already populated when you init Datatables. Datatbles sees 100 rows and should be displaying 10 at a time. That is what I see from the debug output.

    Is the performance issue with loading the data into your table or afterwards once Datatables is loaded?

    Kevin

  • islam.s.e.lislam.s.e.l Posts: 3Questions: 1Answers: 0

    "performance issue with loading the data"
    the reall data rows count is more than 100 k
    but browser take so loge about 5 min to display all records
    when i use the debug I decrease th count to 100 to avoid that

    is there is any way to handel the large data set ?

  • kthorngrenkthorngren Posts: 21,309Questions: 26Answers: 4,947
    Answer ✓

    The Datatables solution for large data is to use server side processing:
    https://datatables.net/manual/server-side

    But for this to work you will need to let Datatables fetch the data. It will send an AJAX request for the starting point and number of rows to be displayed. The server side code is responsible for generating a query to the DB requesting only the desired data subset. This will happen each time the table is drawn for things like paging and searching.

    Not sure if you can fit that into your solution.

    Kevin

  • islam.s.e.lislam.s.e.l Posts: 3Questions: 1Answers: 0

    Thank you Kevin

This discussion has been closed.